Difference between revisions of "Web Element: Google Chart"


Line 18: Line 18:
 
<div id="chart_div_3"></div>
 
<div id="chart_div_3"></div>
 
</body>
 
</body>
 +
</html>
 +
 +
<html>
 +
  <head>
 +
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
 +
    <script type="text/javascript">
 +
      google.charts.load('current');
 +
      google.charts.setOnLoadCallback(drawVisualization);
 +
 +
      function drawVisualization() {
 +
        var wrapper = new google.visualization.ChartWrapper({
 +
          chartType: 'LineChart',
 +
          dataSourceUrl: 'http://spreadsheets.google.com/tq?key=pCQbetd-CptGXxxQIG7VFIQ&pub=1',
 +
          query: 'SELECT A,D WHERE D > 100 ORDER BY D',
 +
          options: {'title': 'Countries'},
 +
          containerId: 'vis_div'
 +
        });
 +
        wrapper.draw()
 +
 +
        // No query callback handler needed!
 +
      }
 +
    </script>
 +
  </head>
 +
  <body style="font-family: Arial;border: 0 none;">
 +
    <div id="vis_div" style="width: 600px; height: 400px;"></div>
 +
  </body>
 
</html>
 
</html>

Revision as of 13:20, 28 April 2020