GWT与来自Google的Charts API示例不起作用 [英] GWT with Charts API example from Google not working

查看:85
本文介绍了GWT与来自Google的Charts API示例不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经下载 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 data = DataTable.create();

Eclipse报告:
com.google.gwt .core.client.JavaScriptException:(TypeError):无法读取未定义的属性'DataTable'。



这里有什么错?


I have downloaded http://code.google.com/p/gwt-google-apis/downloads/detail?name=gwt-visualization-1.1.0.zip&can=2&q= archive that comes with jar that is needed in order to use charts in GWT. In the archive is also example application (http://gwt.google.com/samples/hellovisualization-1.1.0/HelloVisualization.html). But this example is not working for me. It has an runtime error at this line: DataTable data = DataTable.create();

Eclipse reports this: com.google.gwt.core.client.JavaScriptException: (TypeError): Cannot read property 'DataTable' of undefined.

What is wrong here?

解决方案

You should call VisualizationUtils.loadVisualizationApi(onLoadCallback, PieChart.PACKAGE) to load the api and write onLoadCallBack function to do sth. when the API is loaded.

这篇关于GWT与来自Google的Charts API示例不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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