timeofday data type is being drawn 5 hours behind the data I enter.

46 views
Skip to first unread message

Marcus

unread,
Jun 5, 2016, 8:43:31 PM6/5/16
to Google Visualization API

I am trying to draw a simple bar chart using the Google Charts API but I am very confused as to what I'm doing wrong with the 'timeofday' column data type. The Google Charts documentation says that timeofday should be an array of 3 or 4 numbers and they site this as an example


"For example, the time 8:30am would be: [8, 30, 0, 0], with the 4th value being optional ([8, 30, 0] would output the same timeofday value)."


When I open their example in a JSFiddle, the time you see above in my quoted example gets displayed in the bar chart as "3:30:45" This is very perplexing. All of the data I enter for time is displayed as 5 hours behind the hour value I enter. The hour value in the example above is 8, but when drawn becomes a 3.

I also posted this question on stackoverflow if anyone wants to plug an answer there: https://stackoverflow.com/questions/37648128/using-google-charts-timeofday-data-type-is-drawing-the-hour-data-incorrectly-a

Daniel LaLiberte

unread,
Jun 6, 2016, 10:10:27 AM6/6/16
to Google Visualization API
The answer on stackoverflow looks correct.  The Material chart doesn't draw the axis correctly for a timeofday scale, so at best, use theme: 'material' with a corechart.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/3bdf1196-2a5f-4269-b0b8-3a64a83fdbde%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages