I have a php array with data on students. It looks like this:
array(5) {
["question1"]=>
array(30) {
["2014, 03, 02"]=>
array(10) {
["student1"]=>
int(54)
["student2"]=>
int(43)
... etc. ...
["median"]=>
string(2) "49"
}
Each day the students answers five questions with a value from 1 to 100. Each day a median value for all answers to a single question is calculated. The answers and the median value is stored like above.
Now I want to populate a Google Charts combo chart with this data but I just can't get it to work.
I would like to visualise the data with the date on the X-axis, the 1-100 value on the Y-axis and each answer as a point. The data for the median value should be displayed as a curve over the points. Points and curves for each question should have its own colour.
But I'm pretty much stuck. I can't figure out how to insert the data. I have tried this approach:
var jsonData = (<?= json_encode($data)?>);
var data = new google.visualization.arrayToDataTable(jsonData);
but I only get the following error message:
Uncaught Error: Not an array format+da,default+da,ui+da,corechart+da.I.js:181
lda format+da,default+da,ui+da,corechart+da.I.js:181
Gp format+da,default+da,ui+da,corechart+da.I.js:183
drawChart ?side=graf:4888