Google Visualization Charts API examples do not work, how to fix them?

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

Depending on the browser, we see one of the following errors:

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

Documentation-related JSFiddle examples and manual attempts to work with diagrams fail with the same diagnostics.

Is there any way around this?

+5
source share
1 answer

It seems to be a bad version (v44). Until this is fixed, the workaround is to explicitly indicate the 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 really freeze your version of the chart, and you will not receive new features and fixes if you do not return the changes.

+11
source

Source: https://habr.com/ru/post/1243927/


All Articles