Difference between revisions of "Web Element: Data"
Line 179: | Line 179: | ||
<body> | <body> | ||
<div id="chart_div_2"></div> | <div id="chart_div_2"></div> | ||
+ | </body> | ||
+ | </html> | ||
+ | |||
+ | https://docs.google.com/spreadsheets/d/1YUqF27YsO2tVdFL1R6Oxu5BT5itjA_ozZDrekzfFclk/edit?usp=sharing | ||
+ | |||
+ | <html> | ||
+ | <head> | ||
+ | <!--Load the AJAX API--> | ||
+ | <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> | ||
+ | <script type="text/javascript"> | ||
+ | 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_3')); | ||
+ | chart.draw(data, { height: 400 }); | ||
+ | } | ||
+ | </script> | ||
+ | </head> | ||
+ | <body> | ||
+ | <div id="chart_div_3"></div> | ||
</body> | </body> | ||
</html> | </html> |
hkilter.com by H. K. Ilter is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
© 2020 H. K. Ilter