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:
<https://lh3.googleusercontent.com/-XfZtumyg7tc/WGA0Zt-C-DI/AAAAAAAABHQ/dalrMCGqidgjfWzkSXcoxu_BmZZt2nq3gCLcB/s1600/1.PNG>
--
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 [email protected].
To post to this group, send email to [email protected].
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.
<<attachment: graph.php>>
example.xlsx
Description: MS-Excel 2007 spreadsheet
