GWT with Charts API example from Google not working

≯℡__Kan透↙ 提交于 2019-12-21 20:35:12

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/3652640/gwt-with-charts-api-example-from-google-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!