Difference between revisions of "Web Element: Google Chart"


 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
<html>
+
<html><iframe width="300" height="300" seamless frameborder="0" scrolling="no" src="https://docs.google.com/spreadsheets/d/e/2PACX-1vTon6qJGHrb96YGVFVbG2F5zVGij4_y4yGUlVs_RpruJtGJcv4MG54CoG2K41XUcfzANFewFToHA5kj/pubchart?oid=1842936971&amp;format=interactive"></iframe></html>
<head>
 
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
 
    <script type="text/javascript">
 
function drawChart() {
 
  var query = new google.visualization.Query('https://docs.google.com/spreadsheets/d/1YUqF27YsO2tVdFL1R6Oxu5BT5itjA_ozZDrekzfFclk/gviz/tq?sheet=Sheet1&headers=1&range=B2:C20');
 
  query.send(handleQueryResponse);
 
}
 
 
 
function handleQueryResponse(response) {
 
  var data = response.getDataTable();
 
  var chart = new google.visualization.ScatterChart(document.getElementById('chart_div_3'));
 
  chart.draw(data, null);
 
}
 
    </script>
 
</head>
 
<body>
 
<div id="chart_div_3"></div>
 
</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>
 

Latest revision as of 16:13, 28 April 2020