So I am using C3.js, a chart library built on top of the widely used D3.js visualization library. So as a part of the webpage that I am creating with a chart, I want to include a user interaction in which the user can input values for a new object that can be charted along with current objects that are already charted via a form on the html page. I'm using JSON data as the file format that's being read into the chart. I want to know how I can write to/update this file from the javascript code so that the data now includes the new object. As I am a novice with web-based technologies I'm not too sure as to how data gets updated on servers. The server is a localhost created by a file, app.js, which creates a node server.
var express = require('express');
var http = require('http');
var app = express();
app.use(express.static(__dirname + '/public'));
server = http.createServer(app);
server.listen('14000');
I included the above code for my app.js as a reference if that makes any difference. The file format for the json file is as shown below...
[
{name: "Lane Warner",age: 27,height: 231,weight: 120},
{name: "Hickman Bishop",age: 29,height: 125,weight: 180},
{name: "Tracy Sheppard",age: 30,height: 200,weight: 155},
{name: "Madeleine Spence",age: 30,height: 179,weight: 112},
{name: "Alicia Beasley",age: 36,height: 300,weight: 200},
{name: "Bryant Fitzpatrick",age: 23,height: 321,weight: 250},
{name: "Stevenson Mcdonald",age: 30,height: 155,weight: 199},
{name: "Hannah Ratliff",age: 21,height: 189,weight: 136},
{name: "Alexandra Williamson",age: 39,height: 258,weight: 123}
]