get a line chart from php to google chart

71 views
Skip to first unread message

Weiyi Dai

unread,
Mar 28, 2016, 10:55:07 PM3/28/16
to Google Visualization API
hello, 
      i am doing a project to draw a line chart from a xampp php/mysql database. The x-axis is to be the time like 2016-3-13 15:34:16. The y-axis is the value.  I got column and row output in the chart.php as shown in the attachment,  but the line chart does not pop out in the googlechart. html. i want someone can help me scan my code and tell me where I did wrong. i read a lot forum but they are pretty confused.  Thank you very much.  
php database.PNG
chart.php
googlechart.html
output of chartphp.PNG

Weiyi Dai

unread,
Mar 28, 2016, 10:57:00 PM3/28/16
to Google Visualization API


On Monday, March 28, 2016 at 9:55:07 PM UTC-5, Weiyi Dai wrote:
hello, 
      i am doing a project to draw a line chart from a xampp php/mysql database. The x-axis is to be the time like 2016-3-13 15:34:16. The y-axis is the value. is it the reason i use datetime for date in he database?  I got column and row output in the chart.php as shown in the attachment,  but the line chart does not pop out in the googlechart. html. i want someone can help me scan my code and tell me where I did wrong. i read a lot forum but they are pretty confused.  Thank you very much.  

Daniel LaLiberte

unread,
Mar 29, 2016, 9:33:05 AM3/29/16
to Google Visualization API
Hi Weiyi,

Your datetime values are actually strings.  Read about how to deal with dates and times here:  https://developers.google.com/chart/interactive/docs/datesandtimes

--
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/30e7959d-587e-4629-b1f7-6e1aa64ac8d5%40googlegroups.com.

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



--
Reply all
Reply to author
Forward
0 new messages