Effect Chart:
JS Code:
$ (function () {$ (document). Ready (function () {highcharts.setoptions ({global: {useutc:false}
});
var chart; Chart = new Highcharts.chart ({chart: {renderto: ' container ', type: ' Spline ', Animation:hi Ghcharts.svg,//don ' t animate in Old IE marginright:10, events: {load:functi On () {}}}, title: {text: ' Live random Data '}, Xaxis: {type: ' datetime ', tickpixelinterval:150}, YAxis: [{title: {text: ' Value '}, PLO
Tlines: [{value:0, width:1, color: ' #808080 '}]}, {title: { Text: ' Name '}, plotlines: [{value:0, width:1, color: ' #808080 '}]}], tooltip: {formatter:function () {return ' <b> ' + This.series.namE + ' </b><br/> ' + highcharts.dateformat ('%y-%m-%d%h:%m:%s ', this.x) + ' <br/> ' +
Highcharts.numberformat (THIS.Y, 2); }, Legend: {Enabled:false}, exporting: {Enabled:false}, Series
: [{name: ' Random data ', Data: (function () {//Generate an array of Random data
var data = [], time = (new Date ()). GetTime (), I;
for (i = -19; I <= 0; i++) {Data.push ({x:time + i * 1000, y:math.random ()
});
} return data;
} ()}, {name: ' Random data ', Data: (function () {//Generate an array of Random data
var data = [], time = (new Date ()). GetTime (), I;
for (i = -19; I <= 0; i++) {Data.push ({x:time + i * 1000, y:math.random () });
} return data; })()
}]
});
Set up the updating of the chart each second var series = chart.series[0];
var series1 = chart.series[1];
SetInterval (function () {var x = (new Date ()). GetTime (),//Current Time y = Math.random ();
Series.addpoint ([x, Y + 1], true, true);
Series1.addpoint ([x, Y-1], true, true);
}, 1000);
}); });
HTML code:
The above highcharts more than one y-axis dynamic Refresh data implementation code is a small series to share all the content, hope to give you a reference, but also hope that we support the cloud-dwelling community.