i have json dataset millions of points.the structure this:
[[1436997600000,7],[....]]
the first number data , second 1 value. want plot in highchart doesn't take time load chart , navigate in it. followed example: http://www.highcharts.com/stock/demo/lazy-loading
but can't work data. take time load , when zoom message 'loading server' doesn't disappear. can me on please?
js:
$(function () { /** * load new data depending on selected min , max */ function aftersetextremes(e) { var chart = $('#container').highcharts(); chart.showloading('loading data server...'); $.getjson('http://localhost/public_html/webservice.php/re/pap/' + math.round(e.min) + '/' + math.round(e.max), function (data) { chart.series[0].setdata(data); chart.hideloading(); }); } // see source code jsonp handler @ https://github.com/highcharts/highcharts/blob/master/samples/data/from-sql.php $.getjson('http://localhost/public_html/webservice.php/re/pap', function (data) { // add null value end date data = [].concat(data, [[date.utc(2016, 9, 14, 19, 59), null]]); // create chart $('#container').highcharts('stockchart', { chart : { type: 'scatter', zoomtype: 'x' }, navigator : { adapttoupdateddata: false, series : { data : data } }, scrollbar: { liveredraw: false }, title: { text: 'aapl history minute 1998 2011' }, subtitle: { text: 'displaying 1.7 million data points in highcharts stock async server loading' }, rangeselector : { buttons: [{ type: 'hour', count: 1, text: '1h' }, { type: 'day', count: 1, text: '1d' }, { type: 'month', count: 1, text: '1m' }, { type: 'year', count: 1, text: '1y' }, { type: 'all', text: 'all' }], inputenabled: false, // supports days selected : 4 // }, xaxis : { events : { aftersetextremes : aftersetextremes }, minrange: 3600 * 1000 // 1 hour }, yaxis: { floor: 0 }, series : [{ data : data, datagrouping: { enabled: false } }] }); }); });
fiddle: http://jsfiddle.net/f0u5c4pg/
thanks in advance!
Comments
Post a Comment