I am using GWT 2.5 RC1 and GAE 1.7.2.
I created a custom cell using UiRenderer Rendering HTML for Cells.
I want to render a chart using Google Chart Tools API for GWT Getting Started Using the Google Chart Tools with GWT
Below there is snippet of the render method, which does not work.
Does anybody know, how to render a google chart in a custom cell?
I would appreciate it, if he/she give me some directions or sample code.
Thanks in advance.
@Override
public void render(com.google.gwt.cell.client.Cell.Context context, Value value, final SafeHtmlBuilder sb) {
final HTMLPanel test = new HTMLPanel("");
Runnable onLoadCallback = new Runnable() {
public void run() {
//Panel panel = RootPanel.get();
// Create a pie chart visualization.
PieChart pie = new PieChart(createTable(), createOptions());
pie.addSelectHandler(GoogleCharts.createSelectHandler(pie));
test.add(pie);
}
};
// Load the visualization api, passing the onLoadCallback to be called
// when loading is done.
VisualizationUtils.loadVisualizationApi(onLoadCallback, PieChart.PACKAGE);
sb.appendHtmlConstant(test.getElement().getInnerHTML());
renderer.render(sb);
}