date type shifted one day backwards at display on continuous axis

14 views
Skip to first unread message

Lucero del Alba

unread,
Jan 14, 2013, 9:57:42 PM1/14/13
to google-visua...@googlegroups.com
So, reusing some previous examples... notice here how the date display on the candlesticks is shifted one day backwards http://jsfiddle.net/k2hwr/1/ for date data type   At first I though it was one period shifted, then I noticed it was just one day, since it wouldn't matter whether it was weeks, months, days periods...  Interestingly, the data type datetime seems to work just fine http://jsfiddle.net/k2hwr/4/

Why would that be?  Bug?

asgallant

unread,
Jan 14, 2013, 10:29:02 PM1/14/13
to google-visua...@googlegroups.com
That has nothing to do with the Visualization API.  It is an issue with using strings to create Date objects in javascript.  The behavior of strings is seemingly random (from my point of view), whereas using explicit construction always gets you what you want.  See here for a display of the differences: http://jsfiddle.net/asgallant/XEfHB/

Lucero del Alba

unread,
Jan 14, 2013, 10:48:40 PM1/14/13
to google-visua...@googlegroups.com
Wow, that's weird!  I'll get rid of strings then, thanks for the clarification!


--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/SzUlGFtr-9AJ.

To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.



--
    Emiliano
Reply all
Reply to author
Forward
0 new messages