来自 Google 的带有 Charts API 示例的 GWT 无法正常工作

标签 gwt google-visualization

我已经下载了http://code.google.com/p/gwt-google-apis/downloads/detail?name=gwt-visualization-1.1.0.zip&can=2&q=在 GWT 中使用图表所需的 jar 附带的存档。 存档中还有示例应用程序 ( http://gwt.google.com/samples/hellovisualization-1.1.0/HelloVisualization.html )。但这个例子对我不起作用。此行有一个运行时错误: DataTable 数据 = DataTable.create();

Eclipse 报告了这一点: com.google.gwt.core.client.JavaScriptException:(TypeError):无法读取未定义的属性“DataTable”。

这里出了什么问题?

最佳答案

您应该调用 Visualization_Utils.loadVisualizationApi(onLoadCallback, Pie Chart.PACKAGE) 加载 api 并编写 onLoadCallBack 函数来执行某些操作。当 API 加载时。

关于来自 Google 的带有 Charts API 示例的 GWT 无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3652640/

相关文章:

java - 由 ListDataProvider 支持的 GWT CellList 太慢

gwt - 替换 GWT UIBinder XML 文件中的版本号变量

gwt - 调度传入 RPC 调用时出现异常

java - UiBinder 和 SplitLayoutPanel 不显示

php - 使用ajax和php在下拉列表中动态更新谷歌图表

java - gwt java 测试中的火灾事件不改变复选框的值

javascript - Google Charts - 折线图(折线包)上的自定义工具提示不起作用

javascript - Google Charts BarChart OnClick 或 OnSelect

javascript - 在 h 轴上仅显示部分文本

javascript - 谷歌可视化 : Animated Line Graph --incremental rather than all at once?