DateTime problems with LineCharts

40 views
Skip to first unread message

Antonio Bulgheroni

unread,
Feb 5, 2012, 10:23:22 AM2/5/12
to google-visua...@googlegroups.com
Dear all,

  I'm having some issues plotting a Line Chart with the horizontal axis with datetime data. 

You can find everything here: http://grafici-reattori.tk/test/index.php

The situation is the following, I'm retrieving the data to plot from a ajax call returning a JSON formatted set of data (something similar to what is described here). It looks like the json is well formatted because I can draw a table with the corresponding data and they are exactly how I was expecting. 

In the JSON the date is coded according to the documentation, i.e. in a string of this type "Date(2011, 10, 1, 6, 0, 0)" to get Nov. 1st 2011 6a.m. again this is recognized in the Table view.

The line chart is completely empty with the x axis ranging from 01 gen 1970 01:00:00 to 01 gen 1970 01:00:00 and the y axis from 0 to 1,00 (note the comma instead of the point). 

Can you help in sorting this out?   

Thanks in advance for any help!
toto

EZChart

unread,
Feb 6, 2012, 3:24:39 AM2/6/12
to google-visua...@googlegroups.com
It seems that in your JSON you are passing the values as strings and not as numbers, e.g.: {"v":"54"}, where it should be {"v":54}.
This explains why the table chart works and the line chart doesn't.


--
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/-/kRcp4rmcyEgJ.
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.

Antonio Bulgheroni

unread,
Feb 6, 2012, 3:40:18 AM2/6/12
to google-visua...@googlegroups.com
Thanks a lot!

I knew, it was something stupid! A simple floatval in the php fixed my issue and you saved my day!

thanks again.
toto

-----------------------------------------
Antonio Bulgheroni, PhD




Reply all
Reply to author
Forward
0 new messages