Difference between revisions of "Web Element: Google Chart"


 
(17 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 drawSheetName() {
 
      var queryString = encodeURIComponent('SELECT B, C');
 
 
 
      var query = new google.visualization.Query(
 
          'https://docs.google.com/spreadsheets/d/1YUqF27YsO2tVdFL1R6Oxu5BT5itjA_ozZDrekzfFclk/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>
 
</html>
 

Latest revision as of 16:13, 28 April 2020