Question

I have tried out the visualization api using http://code.google.com/p/gwt-google-apis/wiki/VisualizationGettingStarted

But, I wanted to create charts with new visualization API like https://developers.google.com/chart/interactive/docs/gallery/piechart

Is it possible to achieve this using GWTP Uibinders or do I need to use any other ways to achieve this.

Thanks In Advance, Bennet.

Was it helpful?

Solution

It can be done exactl like in this question: How to integrate GWT UIBinder with Canvas?

There is only one difference:

You will need to load a Library at runtime first (I think it is a PlainJavaScript, wrapped by GWT):

Runnable onLoadCallback = new Runnable() {
  public void run() {
    Panel panel = RootPanel.get();

    // Create a pie chart visualization.
    PieChart pie = new PieChart(createTable(), createOptions());

    pie.addSelectHandler(createSelectHandler(pie));
    panel.add(pie);
  }
};
VisualizationUtils.loadVisualizationApi(onLoadCallback, PieChart.PACKAGE);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top