Issue: Currently I am trying to build a live stream graph which will display data in the range of 0.5 hour to 3 hours. So the graph updates continuously, but it updates at the extreme right side of the graph.
Requirement: My requirement is that I want to do the same thing, but it should be done at the centre of the graph. The live stream should be updated at the centre of the graph and right side should contain future time values with no data plotted against it.
I tried plotting null data against future timestamp values, but Stockchart does not accept such kind of data and displays nothing.
Here is a JSFiddle, the important part:
Highcharts.stockChart('container', {
chart: {
events: {
load: function () {
// set up the updating of the chart each second
var series = this.series[0];
setInterval(function () {
var x = (new Date()).getTime(), // current time
y = Math.round(Math.random() * 100);
series.addPoint([x, y], true, true);
}, 1000);
var series1 = this.series[1];
setInterval(function () {
var x = (new Date()).getTime(), // current time
y = Math.round(Math.random() * 100);
series1.addPoint([x, y], true, true);
}, 1000);
var series2 = this.series[2];
setInterval(function () {
var x = (new Date()).getTime(), // current time
y = Math.round(Math.random() * 100);
series2.addPoint([x, y], true, true);
}, 1000);
}
}
},