Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Visualization Charts API examples are broken, how to fix them?

See this page, for example: https://developers.google.com/chart/interactive/docs/quick_start

Depending on a browser we see one of errors as follows:

  • Uncaught ReferenceError: Hh is not defined (in Chrome)
  • TypeError: chart.draw is not a function (in Firefox)

JSFiddle examples linked from the documentation and attempts to work with charts manually fail with the same diagnostics.

Is there any way to work around this?

like image 827
Alexander Gladysh Avatar asked Feb 26 '16 09:02

Alexander Gladysh


People also ask

Is Google charts deprecated?

This article relies excessively on references to primary sources. Please improve this by adding secondary or tertiary sources. The Google Chart API is an interactive Web service (now deprecated) that creates graphical charts from user-supplied data.

Is Google charts an API?

The Google Chart API is an extremely simple tool that lets you easily create a chart from some data and embed it in a webpage. You embed the data and formatting parameters in an HTTP request, and Google returns a PNG image of the chart.

How do you show no data available on Google chart?

Use noData() method to enable "No data" label: chart. noData().


1 Answers

Seems to be a bad release (v44). Until it is fixed, the workaround is to explicitly specify previous version of the API to load instead of using current:

-     google.charts.load('current', {'packages':['gantt']});
+     google.charts.load('43', {'packages':['gantt']});

Please note that this will indeed freeze your charts version and you will not get new features and bugfixes unless you will revert the changes.

like image 182
Alexander Gladysh Avatar answered Oct 02 '22 14:10

Alexander Gladysh