Hi I am new to google charts and am trying a simple visualisation of some data I have on a google spreadsheet:
https://docs.google.com/spreadsheets/d/1dyKk4gfExyR-jDQyESyPb1iUnKmZm2EwJKEHG0AEBSU/edit#gid=0 I have pieced together this code but it doesn't seem to work. I am sure there is just a simple error here. Can anyone help. Thanks. <!DOCTYPE html> <head> <!--Load the AJAX API--> <script type="text/javascript" src=" https://www.google.com/jsapi"></script> <script type="text/javascript"> // Load the Visualization API and the piechart package. google.load('visualization', '1.0', {'packages':['corechart']}); // Set a callback to run when the Google Visualization API is loaded. google.setOnLoadCallback(drawSheetName); function drawSheetName() { var opts = {sendMethod: 'auto'}; var query = new google.visualization.Query( https://spreadsheets.google.com/tq?1dyKk4gfExyR-jDQyESyPb1iUnKmZm2EwJKEHG0AEBSU ); query.send(handleQueryResponse); } function handleQueryResponse(response) { if (response.isError()) { alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage()); return; } var data = response.getDataTable(); var options = {title:'Fruits!'}; var chart = new google.visualization.PieChart(document.getElementById('chart_div')); chart.draw(data, options); } </script> </head> <body> <!--Div that will hold the pie chart--> <div id="chart_div"></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 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/371663ca-0eae-497b-8e58-cbe6c606d360%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
