GWT with Charts API example from Google not working
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.
精彩评论