Charts not working for three days

42 views
Skip to first unread message

cabl...@gmail.com

unread,
Aug 26, 2016, 10:14:45 AM8/26/16
to Google Visualization API
It was brought to my attention today that the charts I had set up have not been working since 8/23. At this point I'm not sure if there is some technical issue going on (though I haven't seen anyone else post about it) or if there was a code change or something broken by an update.

I did see a thread about changes to the loader library code and I tried to implement that but it didn't help.

Does anybody see an issue with my code?

Old Code:

<html>  
<head>    
<script type="text/javascript" src="https://www.google.com/jsapi"></script>    
<script type="text/javascript">      
google.load("visualization", "1", {packages:["gauge"]});      
google.setOnLoadCallback(drawChart);      

function drawChart() {          var data = google.visualization.arrayToDataTable([           ['Label', 'Value'],           ['Agrinomix',1443],           ['CM25',],           ['S3',1698],           ['3B',],           ['Long Rd',]         ]);          var options = {           width: 611, height: 150,           greenFrom: 1382, greenTo: 1625,           redFrom: 800, redTo: 1137,           yellowFrom:1137, yellowTo: 1382,           yellowColor: '#FFF959',           minorTicks: 5,           min: 0,           max: 1625         };          var chart = new google.visualization.Gauge(document.getElementById('chart_div'));          chart.draw(data, options);       }     </script>  
</head>  
<body> <div id="chart_div" style="width: 611px; height: 150px;"></div>  
</body>
</html>


New Code:

<html>
<head>
<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'],           ['Agrinomix',1443],           ['CM25',],           ['S3',1698],           ['3B',],           ['Long Rd',]         ]);          var options = {           width: 611, height: 150,           greenFrom: 1382, greenTo: 1625,           redFrom: 800, redTo: 1137,           yellowFrom:1137, yellowTo: 1382,           yellowColor: '#FFF959',           minorTicks: 5,           min: 0,           max: 1625         };          var chart = new google.visualization.Gauge(document.getElementById('chart_div'));          chart.draw(data, options);       }     </script>  
</head>  
<body> <div id="chart_div" style="width: 611px; height: 150px;"></div>  
</body>
</html>

Daniel LaLiberte

unread,
Aug 26, 2016, 10:37:23 AM8/26/16
to Google Visualization API
The main problem is that your data has an incorrect number of values in a few rows.  If you leave out the last value in an array, that is, at best, ambiguous.  There might have been a change in browsers such that this last value is now ignored, whereas it used to assume it is undefined.  You should use explicit undefined values instead, and then it works, which you can see here:  https://jsfiddle.net/ygmy1tsw/ 

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/6e77554d-ce6e-4dc9-bbc5-3383f765add6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

cabl...@gmail.com

unread,
Aug 26, 2016, 11:01:16 AM8/26/16
to Google Visualization API
Interesting and I appreciate the advice. Sadly, it still does not work. In fact, I even plugged your code directly in as is and still blank. It must be something wrong locally.

cabl...@gmail.com

unread,
Aug 26, 2016, 11:27:57 AM8/26/16
to Google Visualization API
Yeah, looks like a local issue. Thanks again!
Reply all
Reply to author
Forward
0 new messages