I'm in doubt about something with google charts, when i use addRows command, is it enough that my php variable be in the required format?
I'll put the code i'm working with:
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1.0",{"packages":["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart(){
//create the data table
var data = new google.visualization.DataTable();
data.addColumn("string","Fruits");
data.addColumn("number","Amount");
data.addRows([<?php echo "'$jsRows'";?>]);
//set chart options
var options = {"title":"Amount of different fruits",
"width":400,
"height":300};
//instantiate and draw chart, passing in options
var options = new google.visualization.PieChart(document.getElementById("chart_div"));
chart.draw(data, options);
} //end of drawchart function
</script>
When i write: echo $jsRows; i get: ["0 as 6 h",0],["6 as 12h",0],["12 as 18h",8],["18 as 24h",0], which is a data format google chart can handle, but with this code, my chart doesn't appear. Does anyone have any idea why? Thanks in advance!