highslide-software/highcharts.com — Issue #528: Highstocks: Turbo mode issue when using through GWT
Author: mcondor
Created: 2011-10-26 16:21:46+00:00
State: open

I am using Highstocks through GWT. When graphing series that are larger than the turbo threshold, nothing is graphed. The data is provided as a 2-dimensional number array. A single number array works well.

The problem is on line 9660 of highstock.src.js (in setData: function (data,redraw))

```
if (isNumber(firstPoint)) { // assume all points are numbers <-- This call works
...
} else if (firstPoint.constructor === Array) { // assume all points are arrays <-- This call always returns false when data comes through GWT
...
}
```

```firstPoint.constructor === Array``` is returning false.
From '**Javascript: The Good Parts**, pg 106'

"That test will give a false negative if an array was created in a different frame or window." Which is what is going on when interacting with Highstocks through GWT.

An alternate approach is suggested in this stackoverflow thread.
http://stackoverflow.com/questions/1058427/how-to-detect-if-a-variable-is-an-array

```function isArray(obj) {
return Object.prototype.toString.call(obj) === '[object Array]';
}```