简体   繁体   English

Google Visualization Charts API示例已被破坏,如何修复它们?

[英]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 请参阅此页面,例如: 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) Uncaught ReferenceError: Hh is not defined (在Chrome中)
  • TypeError: chart.draw is not a function (in Firefox) TypeError: chart.draw is not a function (在Firefox中)

JSFiddle examples linked from the documentation and attempts to work with charts manually fail with the same diagnostics. 从文档链接的JSFiddle示例以及手动使用图表的尝试都失败了,具有相同的诊断功能。

Is there any way to work around this? 有什么方法可以解决这个问题吗?

Seems to be a bad release (v44). 似乎是一个糟糕的释放 (第44节)。 Until it is fixed, the workaround is to explicitly specify previous version of the API to load instead of using current: 在修复之前,解决方法是明确指定要加载的API的先前版本而不是使用当前版本:

-     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. 请注意,这确实会冻结您的图表版本,除非您还原更改,否则您将无法获得新功能和错误修正。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM