Discussion:
[visualization-api] Charts not working for three days
c***@gmail.com
2016-08-26 14:14:44 UTC
Permalink
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',] ]);
1382, greenTo: 1625, redFrom: 800, redTo: 1137,
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',] ]);
1382, greenTo: 1625, redFrom: 800, redTo: 1137,
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>
--
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+***@googlegroups.com.
To post to this group, send email to google-visualization-***@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.
'Daniel LaLiberte' via Google Visualization API
2016-08-26 14:36:56 UTC
Permalink
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/
Post by c***@gmail.com
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
150, greenFrom: 1382, greenTo: 1625, redFrom: 800,
redTo: 1137, yellowFrom:1137, yellowTo: 1382,
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
150, greenFrom: 1382, greenTo: 1625, redFrom: 800,
redTo: 1137, yellowFrom:1137, yellowTo: 1382,
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>
--
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
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
<https://groups.google.com/d/msgid/google-visualization-api/6e77554d-ce6e-4dc9-bbc5-3383f765add6%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>
***@Google.com <***@google.com> 5CC, Cambridge MA
--
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+***@googlegroups.com.
To post to this group, send email to google-visualization-***@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/CAOtcSJPvnzv8WNA7TaYuyUrw1JLSLXUFDECWCDj6bEP5OhxEnQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
c***@gmail.com
2016-08-26 15:01:15 UTC
Permalink
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.
--
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+***@googlegroups.com.
To post to this group, send email to google-visualization-***@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/ac6204af-89b2-4e42-aa20-6599121faa33%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
c***@gmail.com
2016-08-26 15:27:57 UTC
Permalink
Yeah, looks like a local issue. Thanks again!
--
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+***@googlegroups.com.
To post to this group, send email to google-visualization-***@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/39885e40-a767-45ec-a70e-556e1a4da432%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...