javascript - Highcharts / HighStock issue, series disappearing on dynamic update -


i have high stocks area chart, consuming json api. each n seconds, chart recalls api delta in points.

after few minutes, left hand side series disappears, however, if mouse on it, labels still appear. happens on mac , windows, ff ie chrome , safari. appreciate help.

you can view demo here:

https://dev-mv-charts.azurewebsites.net/goldarea.htm

update: if use below code, take highcharts site, seems work. need replace initial load of random data now.

$(function () {  highcharts.setoptions({     global : {         useutc : true     } });  // create chart $('#container').highcharts('stockchart', {     chart : {         events : {             load : function () {                  // set updating of chart each second                 var series = this.series[0];                 setinterval(function () {                      var _update_url = 'http://api.bullionmark.com/v1/ask?currencyid=2&commodityid=1';                      $.ajax({                         type: 'get',                         url: _update_url}).done(function (resp1) {                              var x2 = parseint(resp1.timestamp) * 1000;                             var y2 = parsefloat(resp1.current);                              //var x = (new date()).gettime(), // current time                             //y = math.round(math.random() * 100);                              series.addpoint([x2, y2], true, true);                          });                  }, 5000);             }         }     },      rangeselector: {         buttons: [{             count: 1,             type: 'minute',             text: '1m'         }, {             count: 5,             type: 'minute',             text: '5m'         }, {             type: 'all',             text: 'all'         }],         inputenabled: false,         selected: 0     },      title : {         text : 'live random data'     },      exporting: {         enabled: false     },      series : [{         name : 'random data',         type : 'area',         data : (function () {             // generate array of random data             var data = [], time = (new date()).gettime(), i;              (i = -999; <= 0; += 1) {                 data.push([                     time + * 1000,                     math.round(math.random() * 100)                 ]);             }             return data;         }())     }] });  }); 


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -