Problem positioning and sizing guages

28 views
Skip to first unread message

Christopher Plummer

unread,
Oct 15, 2020, 2:48:51 PM10/15/20
to Google Visualization API
On: http://tablero-mexico.com I want to increase the size of the gauges.  When I try they go off center.  Also, the W3 schools validator returns the warning and error below despite my having copied directly from google gauges.
Thanks to anyone who can help me with this!  Kind regards

Warning: The type attribute is unnecessary for JavaScript resources.
From line 624, column 4; to line 624, column 34
cript>↩ <script type="text/javascript">↩Warning: The type attribute is unnecessary for JavaScript resources.
From line 624, column 4; to line 624, column 34
cript>↩   <script type="text/javascript">↩     

Error: td start tag in table body.
From line 675, column 29; to line 676, column 12
"columns">↩        <td><div i


  Here is an example of my code:
<div>
 <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
   <script type="text/javascript">
      google.charts.load('current', {'packages':['gauge']});
      google.charts.setOnLoadCallback(drawChart);

      function drawChart() {

 var data = google.visualization.arrayToDataTable([
                ['Label', 'Value'],
         ['México', -9.0],
          ['EUA', -4.3],
  ['Chile', -6.1],
          ['España', -12.8]
        ]);

        var options = {
min: -15,
max: 15,
           width: 400, height: 120,
          redFrom: -15, redTo: -1,
          greenFrom:1, greenTo: 15,
          minorTicks: 5
        };

        var chart = new google.visualization.Gauge(document.getElementById('chart_div'));

        chart.draw(data, options);

      setInterval(function() {
          data.setValue(-15, 0, 15 + Math.round(0 * Math.random()));
          chart.draw(data, options);
        }, 0);
     setInterval(function() {
          data.setValue(-15, 0, 15 + Math.round(0 * Math.random()));
          chart.draw(data, options);
        }, 0);
setInterval(function() {
          data.setValue(-15, 0, 15 + Math.round(0 * Math.random()));
          chart.draw(data, options);
        }, 0);
       setInterval(function() {
          data.setValue(-15, 0, 15 + Math.round(0 * Math.random()));
          chart.draw(data, options);
        }, 0);
      }
    </script>
</div>


Reply all
Reply to author
Forward
0 new messages