0

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
Vladimir Starkov
  • 19,264
  • 8
  • 60
  • 114
cypronmaya
  • 520
  • 1
  • 11
  • 24

1 Answers1

2

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/

eolsson
  • 12,567
  • 3
  • 41
  • 43
  • thank you :) BTW how to show minutes also in x-axis or atleast in tooltip because it specifies exact time of data right,otherwise it will indicates just data is in just between x and y time – cypronmaya Nov 30 '11 at 15:07
  • Check this answer for how labels on datetime axes works: http://stackoverflow.com/questions/7101464/how-to-get-highcharts-dates-in-the-x-axis/7104992#7104992 – eolsson Dec 01 '11 at 12:15