Not Plotting in Safari

109 views
Skip to first unread message

Mike Malamud

unread,
Sep 25, 2012, 11:02:04 AM9/25/12
to flot-...@googlegroups.com
I have a few graphs that render perfectly in Chrome and Firefox, but not in Safari (5.1.7)

The grid, axis, tick labels and legend all render, but the points are not being displayed in the graph.

It is a time series graph. I commented out the " mode: 'time' " to see if that had any effect, but it did not.

Any thoughts?

Mike Malamud

unread,
Oct 17, 2012, 11:49:10 AM10/17/12
to flot-...@googlegroups.com
Hey dude, thanks for the response. I actually came to the same conclusion. Chrome's Date constructor is a lot more forgiving than other browsers. 


On Wed, Oct 17, 2012 at 11:29 AM, Zachary Lippard <zlip...@gmail.com> wrote:
Hope this will help because I had the same exact problem and couldn't figure out for the life of me what I was doing wrong.  When converting the start and end points on my xaxis I was using the format 'new Date("yyyy-mm-dd").getTime()'.  After some head-scratching and debugging, I found out that in Safari, the returned value from this function is NaN.  Change the date format to 'new Date(yyyy, mm, dd, 0, 0, 0, 0).getTime()' and it works!  Just remember that in this case, mm starts at 0 (so, January = 0, February = 1,...)

-Zac

Juan Mendes

unread,
Oct 24, 2012, 9:06:56 PM10/24/12
to flot-...@googlegroups.com
Note that it would work fine if you used slashes instead of dashes http://www.htmlgoodies.com/html5/javascript/date-creation-in-javascript.html#fbid=ka_kuR32GmD

    new Date('2012/11/25')
--
Juan Mendes
Reply all
Reply to author
Forward
0 new messages