5

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?

Community
  • 1
  • 1
Alexander Schmidt
  • 5,631
  • 4
  • 39
  • 79
  • 2
    It's by design, see turboThreshold setting: http://api.highcharts.com/highcharts#plotOptions.line.turboThreshold – Mark Jan 28 '14 at 04:09
  • 1
    the default turboThreshold value is 1000, please change it to get it done. API: http://api.highcharts.com/highcharts#plotOptions.line.turboThreshold – Strikers Jan 28 '14 at 07:22
  • 1
    And you have off-by-one error in for loop: `i <= maxItems` should be `i < maxItems`. – Anto Jurković Jan 28 '14 at 09:27

2 Answers2

12

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.

Anto Jurković
  • 11,188
  • 2
  • 29
  • 42
0

Set the turboThreshold: 0 in plotOptions > series option. Like this :-

 plotOptions: {
 series: {
        turboThreshold: 0} }