Can't get Google charts to recognize Dates in my json

29 views
Skip to first unread message

dead...@gmail.com

unread,
May 26, 2016, 6:11:55 PM5/26/16
to Google Visualization API
My json is formatted thusly:
[["{type: 'date', label: 'time_logged'}","load_1m","load_5m"],["\"Date(16, 05, 25, 01, 05, 53)\"",0.55,0.56],["\"Date(16, 05, 25, 01, 05, 26)\"",0.51,0.55]...


I load the data using google.visualization.arrayToDataTable(jdata);

When I plot the data (scatter plot) it treats the time_logged x-axis value ordinary instead of cardinally. I (obviously) want them plotted cardinally.

How do I get Google charts to recognize dates so I can plot them cardinally?

Thanks

dead...@gmail.com

unread,
May 26, 2016, 7:01:23 PM5/26/16
to Google Visualization API
PS: I think I solved it by not using the array format but instead the long-winded format which is loaded with DataTable instead of arrayToDataTable. Odd the array format wouldn't work.

Daniel LaLiberte

unread,
May 26, 2016, 7:23:44 PM5/26/16
to Google Visualization API
You have an extra set of quotes on your dates.  Remove the escaped quotes inside your quotes and it should work better.

--
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/31b93489-a51b-48b5-91c3-95894303becc%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages