I want to use the Visualization javascript API from Google in my GWT project. I am using the JSNI methods but it didn't work :
private native void drawChart() /*-{
drawChart = function() {
// Create the data table.
var data = new $wnd.google.visualization.DataTable();
$wnd.data.addColumn('string', 'Topping');
$wnd.data.addColumn('number', 'Slices');
$wnd.data.addRows([
['Mushrooms', 3],
['Onions', 1],
['Olives', 1],
['Zucchini', 1],
['Pepperoni', 2]
]);
// Set chart options
var options = {'title':'How Much Pizza I Ate Last Night',
'width':400,
'height':300};
// Instantiate and draw our chart, passing in some options.
var chart = new $wnd.google.visualization.PieChart($doc.getElementById('chart_div'));
$wnd.chart.draw(data, options);
}
$wnd.google.load('visualization', '1.0', {'packages':['corechart']});
$wnd.google.setOnLoadCallback(drawChart);
}-*/;
I know that there's a GWT wrapper for this API but the javascript Visualisation API
contains more Chart types and more features; for example I want to use ChartEditor
in my GWT Project : like here
Does anyone have an example or an idea to make it work ?