Hi ! I need for a project to create a website where live charts would be automatically update from a data website.
For the moment i try to make the example of the tutorial (here : https://developers.google.com/chart/interactive/docs/spreadsheets#sheet-name ) but it doesn't work. I suppose i haven't well introduced the code. Could you please tell what is wrong ? <html> > <head> > <title>Google Charts Tutorial</title> > <script type="text/javascript" > src="https://www.gstatic.com/charts/loader.js"></script> > <script type="text/javascript"> > google.charts.load('current', {packages: ['corechart','line']}); > </script> > </head> > <body> > <div id="container" style="width: 550px; height: 400px; margin: 0 > auto"></div> > <script language="JavaScript"> > function drawChart() { > // Define the chart to be drawn. > function drawSheetName() { > var queryString = encodeURIComponent('SELECT A, H, O, Q, R, U LIMIT > 5 OFFSET 8'); > > var query = new google.visualization.Query( > > 'https://docs.google.com/spreadsheets/d/1XWJLkAwch5GXAt_7zOFDcg8Wm8Xv29_8PWuuW15qmAE/gviz/tq?sheet=Sheet1&headers=1&tq=' > > + queryString); > query.send(handleSampleDataQueryResponse); > } > > function handleSampleDataQueryResponse(response) { > if (response.isError()) { > alert('Error in query: ' + response.getMessage() + ' ' + > response.getDetailedMessage()); > return; > } > > var data = response.getDataTable(); > var chart = new > google.visualization.ColumnChart(document.getElementById('chart_div')); > chart.draw(data, { height: 400 }); > } > > // Set chart options > var options = {'title' : 'Average Temperatures of Cities', > hAxis: { > title: 'Month' > }, > vAxis: { > title: 'Temperature' > }, > 'width':550, > 'height':400 > }; > > // Instantiate and draw the chart. > var chart = new > google.visualization.LineChart(document.getElementById('container')); > chart.draw(data, options); > } > google.charts.setOnLoadCallback(drawChart); > </script> > </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/1734423b-a2de-45eb-8631-a4639ba7c54b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
