Google Charts错误 - 未捕获TypeError:undefined不是函数 [英] Google Charts error - Uncaught TypeError: undefined is not a function

查看:86
本文介绍了Google Charts错误 - 未捕获TypeError:undefined不是函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我目前在以下代码行中遇到错误(Uncaught TypeError:undefined不是函数)。我添加了'LoadCallBack'代码行,但我似乎无法解决。



Hello,

I am currently expericing the an error (Uncaught TypeError: undefined is not a function ) on the following line of code. I added 'LoadCallBack' code line but I cannot seem to solve.

google.setOnLoadCallback(drawVisualization);

            new google.visualization.Dashboard(document.getElementById('PieChartExample')).bind([categoryPicker], [pie, table]).draw(data);







非常感谢任何建议或帮助。

非常感谢。




Any suggestion or help would be very much appreciated.
Many thanks.

推荐答案

google.visualization.Dashboard 未定义,因为控件包还没有被加载。



所以还要包含要加载的包中的控件,就像这样

google.visualization.Dashboard is undefined because the controls package has not been loaded.

So also include controls in the packages to load, like so
google.load('visualization', '1', { packages: ['corechart', 'controls'] });





应该修复它。


这篇关于Google Charts错误 - 未捕获TypeError:undefined不是函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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