Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum number of datapoints allowed in a highcharts/stock series data hash

I seem to be running into some kind of limit to the number of datapoints I can have in my series datahash. I am creating my data hash like so:

var data_hash = [];
var limit = 1000;
for(var i = 0; i < limit; i++)
{
    data_hash.push({myData:'blah', 
                         x: i, 
                         y: (i+1)});
}

$(function() {
    $('#container').highcharts('StockChart', {
        tooltip: {
            formatter: function() {
                var s = '';

                $.each(this.points, function(i, point) {
                    s += 'x: '+ point.x;
                    s += ', y: '+point.y;
                });

                return s;
            }
        },
        series: [{
            name: 'series_limit',
            data: data_hash
        }]
    });
});

If I set the limit variable to 1000 or lower the graph will render just fine. However if I were to increase it to any value higher than that the graph will stop rendering. Is there something wrong with the way I am constructing my hash? Or is there some kind of configuration setting I can change to increase the number of datapoints allowed?

Here is a link to the jsfiddle: http://jsfiddle.net/hYtUj/13/

like image 336
jumpingstep Avatar asked Mar 12 '14 21:03

jumpingstep


1 Answers

Default number of datapoints before highcharts starts using arrays is 1000.You can change this value in chart options(parameter threshold)

like image 54
vborutenko Avatar answered Sep 18 '22 20:09

vborutenko