Google可视化图表API示例已损坏,如何修复它们? [英] Google Visualization Charts API examples are broken, how to fix them?

查看:79
本文介绍了Google可视化图表API示例已损坏,如何修复它们?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请参阅此页面,例如: https://developers.google.com/chart/interactive/docs/ quick_start



根据浏览器的不同,我们会看到以下错误之一:


  • Uncaught ReferenceError:Hh未定义(在Chrome中) 不是函数(在Firefox中)



从文档链接的JSFiddle示例并尝试使用图表手动失败,相同的诊断。

有什么办法可以解决这个问题吗?

解决方案

好像是糟糕的版本(v44)。在解决此问题之前,解决方法是明确指定要加载的API的先前版本,而不是使用当前版本:

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

请注意,这确实会冻结您的图表版本,您将不会获得新功能和错误修正,除非您将恢复更改。


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?

解决方案

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.

这篇关于Google可视化图表API示例已损坏,如何修复它们?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆