Difference between revisions of "Web Element: Data"


 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
{|
 +
| width=50% |
 
<html>
 
<html>
 
   <head>
 
   <head>
Line 78: Line 80:
 
                 },
 
                 },
 
          1: {type: 'bars', color: 'black'},},
 
          1: {type: 'bars', color: 'black'},},
//        'width':600,
+
//        'width':300,
           'height':400,
+
           'height':300,
 
//        crosshair: { trigger: 'both', opacity: 0.5 },
 
//        crosshair: { trigger: 'both', opacity: 0.5 },
 
//        trendlines: { 1: {} }    // Draw a trendline for data series 1,
 
//        trendlines: { 1: {} }    // Draw a trendline for data series 1,
Line 94: Line 96:
 
</body>
 
</body>
 
</html>
 
</html>
 
+
|
  
 
<html>
 
<html>
Line 167: Line 169:
 
           vAxis: {title: 'Daily cases', scaleType: 'log'},
 
           vAxis: {title: 'Daily cases', scaleType: 'log'},
 
           legend: 'none',
 
           legend: 'none',
           'height':400,
+
           'height':300,
 
         };
 
         };
  
Line 181: Line 183:
 
</body>
 
</body>
 
</html>
 
</html>
 
+
|}
===Test===
 
 
 
https://docs.google.com/spreadsheets/d/1YUqF27YsO2tVdFL1R6Oxu5BT5itjA_ozZDrekzfFclk/edit?usp=sharing
 
 
 
<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 12:34, 17 May 2020