LightningSorc
LightningSorc

Reputation: 50

Receiving incorrect datetimes when using milliseconds for x-axis?

Here is a link to the jsfiddle. For some reason my datetimes are showing up incorrectly as you can see below.

I have confirmed that the milliseconds were correct so I'm led to believe that it's a bug with the library however I've seen examples using Date.UTC that work correctly but I can't seem to find any examples in their documentation that uses milliseconds instead.

Millisecond values were: 1326113281133,1326113401128, 1326113521102, 1326113641108,1326113761129,1326113881139,1326114001156,1326114241198.

Any help would be much appreciated in helping to find out the cause of this issue.

Upvotes: 2

Views: 1593

Answers (1)

austin
austin

Reputation: 1171

its not a bug in the library, the timestamps are shifted to Universal Time in the chart.

use the following code before your chart variable declaration

Highcharts.setOptions({
global: {
    useUTC: false
}
});

here is the reference to use this option http://www.highcharts.com/ref/#global--useUTC

Upvotes: 5

Related Questions