Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handling unix timestamp with highcharts

jsfiddle: http://jsfiddle.net/RjPRd/

Times & Labels are displayed incorrectly.

I think the timestamp should be multiplied by 1000 for Javascript Time but what's the best approach? Also I believe the setup is still incorrect because the labels seem opposite to where the cursor is.

like image 960
Hedde van der Heide Avatar asked Apr 15 '12 09:04

Hedde van der Heide


1 Answers

You are right, timestamps in Javascript are milliseconds so you should multiply everything by 1000.

For the other problem it comes from the fact that your data is ordered backwards. Apparently HighCharts is messing up when the series are not properly ordered.

Here's the correction for your code: http://jsfiddle.net/cvedovini/RjPRd/2/

like image 150
Claude Vedovini Avatar answered Sep 20 '22 12:09

Claude Vedovini