Question

Here (jsfiddle) is my code with data. The graph generated is pretty messy can someone help me on this?

My data is at intervals like following:

hours:mins
10:13
15:15
18:14
22:13
00:13

at random time.

I have converted them to milliseconds, no problem with that, but to show them in Highcharts there's some problem in it, may be I didn't call req functions to format data to show proper in here or something.

Some dates in understandable format:

Tue Nov 08 10:13:00 IST 2011
Tue Nov 08 15:15:00 IST 2011
Tue Nov 08 18:14:00 IST 2011
Tue Nov 08 22:13:00 IST 2011
Wed Nov 09 00:13:00 IST 2011
Wed Nov 09 03:13:00 IST 2011
Wed Nov 09 06:13:00 IST 2011
Wed Nov 09 10:13:00 IST 2011
Wed Nov 09 15:13:00 IST 2011
Wed Nov 09 18:13:00 IST 2011
Wed Nov 09 22:13:00 IST 2011
Thu Nov 10 00:13:00 IST 2011
Was it helpful?

Solution

Highstock requires the time data to be sorted. Adding this before the rendering solves your problem:

data.sort(function (a, b) {
    return a[0] - b[0];
});

Updated example: http://jsfiddle.net/CYJAk/3/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top