Hi everyone, I have a php file that returns an array and I'm trying to use those data to create a Google Chart Calendar visualization.
The php file is here: http://ebib.com.br/plotsus/data/dados.php And below is my html code. If I just paste the results from PHP inside dataTable.addRows([ ... ]); everything goes ok, but not happens when I use the code below. Please help! <html> <head> <script language="javascript" type="text/javascript" src= "http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"> </script> <script type="text/javascript" src="https://www.google.com/jsapi" ></script> <script type="text/javascript"> google.load("visualization", "1.1", {packages:["calendar"]}); google.setOnLoadCallback(drawChart); function drawChart() { var jsonData = $.ajax({ url: "dados.php", dataType: "json", async: false }).responseText; var dataTable = new google.visualization.DataTable(); dataTable.addColumn({ type: 'date', id: 'Date' }); dataTable.addColumn({ type: 'number', id: 'Won/Loss' }); dataTable.addRows([ jsonData ]); var chart = new google.visualization.Calendar(document.getElementById ('calendar_basic')); var options = { title: "Red Sox Attendance", height: 350, }; chart.draw(dataTable, options); } </script> </head> <body> <div id="calendar_basic" style="width: 1000px; height: 350px;"></div> </body> </html> -- 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.
