Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 228
DixieFlatline Avatar asked Dec 13 '25 18:12

DixieFlatline


1 Answers

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

like image 50
DixieFlatline Avatar answered Dec 15 '25 07:12

DixieFlatline



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!