gmmoraesbr / flot

Automatically exported from code.google.com/p/flot
0 stars 0 forks source link

Time axis chart fails to render in Safari & Chrome when specifying min and max time values for x-axis. #322

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Flot version 0.6
Safari version Version 4.0.4 (6531.21.10)
Chrome version 5.0.307.11 beta for OSX snow leapard (also fails on windows)
Also fails in Firefox on windows (but works on Mac)

If a min and max is specified for the x axis, like this:
x = {
mode: "time",
minTickSize: [1, "day"],
min: (new Date("2010-01-14")).getTime(),
max: (new Date("2010-03-15")).getTime()
}

Then the chart fails to render, like in the attached screenshot, with NaN
on the x-axis.  If the min and max options are removed, it renders nicely
but on an automatically computed min & max.  It only seems to work in FF on
Mac with the specified min & max.  

Original issue reported on code.google.com by udi.falk...@gmail.com on 15 Mar 2010 at 3:11

Attachments:

GoogleCodeExporter commented 8 years ago
On my Firefox on Linux, the expression (new Date("2010-01-14")).getTime() 
returns
NaN. You could try new Date(2010, 1, 14) instead.

Hope this helps, I'm going to close the issue as it doesn't seem to be a bug in 
Flot.

Original comment by olau%iol...@gtempaccount.com on 16 Mar 2010 at 12:26

GoogleCodeExporter commented 8 years ago
Thanks!  The example might warrant updating here:
http://people.iola.dk/olau/flot/examples/time.html  

It uses a string as input to Date(), although it seems that the slash based 
format
used there is more reliable.  

Original comment by udi.falk...@gmail.com on 16 Mar 2010 at 3:30

GoogleCodeExporter commented 8 years ago
Hm, yeah. Sorry. I've fixed the SVN version of that example right now.

Original comment by olau%iol...@gtempaccount.com on 16 Mar 2010 at 4:05

GoogleCodeExporter commented 8 years ago

Original comment by dnsch...@gmail.com on 4 Jun 2012 at 2:39