My JSON data is:{ "cols":
[{"id":"","label":"Date2","pattern":"","type":"number"},
{"id":"","label":"OK Count","pattern":"","type":"date"} ], "rows": [
{"c":[{"v": 2 ,"f": null},{"v": "Date(2015,04,09) ","f": null }]},
{"c":[{"v": 10 ,"f": null},{"v": "Date(2015,04,10) ","f": null }]},
{"c":[{"v": 4 ,"f": null},{"v": "Date(2015,04,11) ","f": null }]},
{"c":[{"v": 4 ,"f": null}, {"v": "Date(2015,04,20)","f": null }]} ] }
Part of my script is:
<!--Load the AJAX API-->
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript" src="jquery-1.9.1.min.js"></script>
<script type="text/javascript">
// Load the Visualization API and the piechart,table package.
google.load('visualization', '1', {'packages':['corechart']});
function drawItems(num) {
var jsonPieChartData = $.ajax({
url: "getdata.php",
data: "q="+num,
dataType:"json",
async: false
}).responseText;
// Create our data table out of JSON data loaded from server.
var piechartdata = new google.visualization.DataTable(jsonPieChartData);
// Instantiate and draw our pie chart, passing in some options.
var chart = new
google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(piechartdata, {
width: 800,
height: 600,
pointSize:5,
chartArea: { left:"10%",top:"10%",width:"80%",height:"80%" },
legend: {position:'top'},
hAxis: {
title: "Date1"
}
});
}
I don't think so that there is any error in it. But it gives error
"Undefined is not a function" all the time. What could be the reason of it?
--
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 http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.