Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highcharts buggy with more than 999 items in series data?

I created an example fiddle. It is using some techniques coming from Nicks answer on this Question.

When I tried to do it with my data model nothing happened. A debug session showed me that if I do:

var maxItems = 1000;
var chartData = new Array(maxItems);
for (var i = 0; i <= maxItems; i++) {
    chartData[i] = { y: 3, x: 1380385867013, myData:'hello' };
}

Highcharts will not display anything. If I then change the value of maxItems to 999 it will work.

Another strange thing is, that when I use:

chartData[i] = [ 1380385867013, 3 ];

I can as much items as I want but I need the "myData" option to add tooltips there. What now?

like image 785
Alexander Schmidt Avatar asked Dec 25 '22 14:12

Alexander Schmidt


1 Answers

Running your jsfiddle example with opened console log shows:

Highcharts error #12: www.highcharts.com/errors/12

Content of that link:

Highcharts Error #12

Highcharts expects point configuration to be numbers or arrays in turbo mode

This error occurs if the series.data option contains object configurations and the number of points exceeds the turboThreshold. It can be fixed by either setting the turboThreshold option to a higher value, or changing your point configurations to numbers or arrays. See turboThreshold.

Highcharts docs about turboThreshold:

turboThreshold: Number

When a series contains a data array that is longer than this, only one dimensional arrays of numbers, or two dimensional arrays with x and y values are allowed. Also, only the first point is tested, and the rest are assumed to be the same format. This saves expensive data checking and indexing in long series. Set it to 0 disable. Defaults to 1000.

So, users Mark and strikers are right.

like image 126
Anto Jurković Avatar answered Dec 28 '22 07:12

Anto Jurković