Highcharts - Dyanmic graph with no initial data -


if open jsfiddle dynamic spline update loads series 20 points before starts updating every second.

example

i don't want display initial data , let interval add points come in.

so change:

series: [{             name: 'random data',             data: (function() {                 // generate array of random data                 var data = [],                     time = (new date()).gettime(),                     i;                  (i = -19; <= 0; i++) {                     data.push({                         x: time + * 1000,                         y: math.random()                     });                 }                 return data;             })()         }] 

to

series: [{             name: 'random data',             data: []         }] 

but doesnt add points. there missing?

change load function shift parameter doesn't apply before you've added 20 values, see this jsfiddle

load: function() {      // set updating of chart each second     var series = this.series[0],         maxsamples = 20,         count = 0;     setinterval(function() {         var x = (new date()).gettime(), // current time             y = math.random();         series.addpoint(             [x,y]             , true             , (++count >= maxsamples)         );     }, 1000); } 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -