{"cols":[{"label":"datetime","type":"datetime"},{"label":"RPI1","type":"number"},{"label":"RPI2","type":"number"}],"rows":[{"c":[{"v":"Date(2016, 11, 25, 16, 29, 29)"},{"v":"20"},{"v":"12"}]},{"c":[{"v":"Date(2016, 11, 25, 16, 33, 22)"},{"v":"15"},{"v":"25"}]}]}
{"cols":[{"label":"datetime","type":"datetime"},{"label":"RPI1","type":"number"},{"label":"RPI2","type":"number"}],"rows":[{"c":[{"v":"Date(2016, 11, 25, 16, 29, 29)"},{"v":"15"},{"v":"12"}]},{"c":[{"v":"Date(2016, 11, 25, 16, 33, 22)"},{"v":"15"},{"v":"25"}]}]}
--
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-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@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/0cad39eb-bbe4-4bc5-a1d3-edef7b5e1913%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Gianni,Looks like your numbers needs to be non-string numeric values, not strings. The Dates are a special case because to create a real date, you would have to use new Date(...) which is not allowed in JSON, so the Google Charts data can include "Date(..)" strings instead.
On Sun, Dec 25, 2016 at 4:13 PM, Gianni Declercq <g.decl...@gmail.com> wrote:
Hello,What I'm trying to create is a chart with multiple lines. I have for example 2 Raspberry Pi's which temperature data gets feed to the database. Each RPI has a unique ID which I call UID.I'm trying to loop over my query as you can see in my code so that I can create a seperate line for each RPI. But I'm having problems putting the temperature data from the database in an array. When for example the data when converted to json should be{"cols":[{"label":"datetime","type":"datetime"},{"label":"RPI1","type":"number"},{"label":"RPI2","type":"number"}],"rows":[{"c":[{"v":"Date(2016, 11, 25, 16, 29, 29)"},{"v":"20"},{"v":"12"}]},{"c":[{"v":"Date(2016, 11, 25, 16, 33, 22)"},{"v":"15"},{"v":"25"}]}]}
it outputs{"cols":[{"label":"datetime","type":"datetime"},{"label":"RPI1","type":"number"},{"label":"RPI2","type":"number"}],"rows":[{"c":[{"v":"Date(2016, 11, 25, 16, 29, 29)"},{"v":"15"},{"v":"12"}]},{"c":[{"v":"Date(2016, 11, 25, 16, 33, 22)"},{"v":"15"},{"v":"25"}]}]}
I guess there is something going wrong when putting the temperature data in the DatabaseArray. But I can't seem to figure out how to do it the right way. (I'm a bit new when it comes to PHP)My code is posted as a attachment, also an example of how it should approximatily look like in Excel.
A picture of my database table:
--
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-visualization-api+unsub...@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/0cad39eb-bbe4-4bc5-a1d3-edef7b5e1913%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hello, Daniel,Is it possible to give me an example how to do it the way I intended it to work?
I really like to understand what I need to change as it would be a good exercise for me.
Op dinsdag 27 december 2016 17:48:59 UTC+1 schreef Daniel LaLiberte:
Hi Gianni,Looks like your numbers needs to be non-string numeric values, not strings. The Dates are a special case because to create a real date, you would have to use new Date(...) which is not allowed in JSON, so the Google Charts data can include "Date(..)" strings instead.
On Sun, Dec 25, 2016 at 4:13 PM, Gianni Declercq <g.decl...@gmail.com> wrote:
Hello,What I'm trying to create is a chart with multiple lines. I have for example 2 Raspberry Pi's which temperature data gets feed to the database. Each RPI has a unique ID which I call UID.I'm trying to loop over my query as you can see in my code so that I can create a seperate line for each RPI. But I'm having problems putting the temperature data from the database in an array. When for example the data when converted to json should be{"cols":[{"label":"datetime","type":"datetime"},{"label":"RPI1","type":"number"},{"label":"RPI2","type":"number"}],"rows":[{"c":[{"v":"Date(2016, 11, 25, 16, 29, 29)"},{"v":"20"},{"v":"12"}]},{"c":[{"v":"Date(2016, 11, 25, 16, 33, 22)"},{"v":"15"},{"v":"25"}]}]}
it outputs{"cols":[{"label":"datetime","type":"datetime"},{"label":"RPI1","type":"number"},{"label":"RPI2","type":"number"}],"rows":[{"c":[{"v":"Date(2016, 11, 25, 16, 29, 29)"},{"v":"15"},{"v":"12"}]},{"c":[{"v":"Date(2016, 11, 25, 16, 33, 22)"},{"v":"15"},{"v":"25"}]}]}
I guess there is something going wrong when putting the temperature data in the DatabaseArray. But I can't seem to figure out how to do it the right way. (I'm a bit new when it comes to PHP)My code is posted as a attachment, also an example of how it should approximatily look like in Excel.
A picture of my database table:
--
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-visualization-api+unsubscr...@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/0cad39eb-bbe4-4bc5-a1d3-edef7b5e1913%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@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/cc5a5613-4b42-4c83-a3fb-14ff9c33f2f0%40googlegroups.com.