Trying to wrap my head around dynamically updating a line graph with new data, shifting the graph to the left and adding fresh data from the right - you following me? Want it to behave just like the examples on
I'm fairly new to d3 (javascript) and looking to incorporate external JSON data.
[
{"Values": ["1.59"], "Datetime": "2016-12-10 14:29:22.007"},
{...}
{"Values": ["1.91"], "Datetime": "2016-12-10 14:29:23.230"},
{...}
{"Values": ["0.52"], "Datetime": "2016-12-10 14:29:23.238"}
]
The examples I've come across mostly focus on generated data or replacing one file with another.
Is there a way to tackle this issue by working with just one json datafile and utilizing array methods?
Thanks in advance for any guidance!
d3.json("https://api.myjson.com/bins/1814gv", function (error, data) {
if (error) throw error;
// format the data
data.forEach(function (d) {
d.Datetime = parseTime(d.Datetime);
d.Values = +d.Values;
});
...