Google Visualization API consists of a number of charts, maps, and graphs for the visualization of data. See
http://code.google.com/apis/visualization/documentation/gallery.html
The 10 new widgets for Eclipse RAP include:
(1) MotionChart, which I believe is Google's implementation of the Trendalyzer, as seen on gapminder.org and at TED -
http://www.ted.com/index.php/talks/hans_rosling_shows_the_best_stats_you_ve_ever_seen.html
(2) line chart
(3) scatter chart
(4) partial implementation of GeoMap (regions supported, markers not supported)
(5) pie chart
(6) column chart
(7) bar chart
(8) area chart
(9) gauge
(10) timeline
All widgets permit any supported settings to be passed into the widget. Each widget expects a characteristic format of data. See the Google Visualization API documentation for each widget.
All except gauge and motion chart send selection events to RAP.
Example code:
JSONGoogleDataTable dataTable = new JSONGoogleDataTable();
dataTable.addColumn("theyear", "Date", "string", null);
dataTable.addColumn("CO2", "CO2", "number", null);
dataTable.addColumn("Temperature", "Temperature", "number", null);
dataTable.addRow(new Object[] {"1970", 325, 14.1});
dataTable.addRow(new Object[] {"2009", 389, 14.7});
widgetData = dataTable.toString();
ColumnChart chart = new ColumnChart( composite, SWT.NONE );
chart.setWidgetOptions("{width: 300, height: 300}");
chart.setWidgetData(serializedData);
gridData = new GridData(300, 300);
chart.setLayoutData(gridData);
...
public void handleEvent(Event event) {
log.info("Event: " + event);
VisualizationWidget widget = (VisualizationWidget)event.widget;
log.info( "Selected item=" + widget.getSelectedItem() + "; row=" + widget.getSelectedRow() +
"; column=" + widget.getSelectedColumn() +
"; value=" + widget.getSelectedValue());
}
Most are Flash components. No Google API key is required for the current implementation. I am currently hosting the code here in the repository for my project INQLE, however I can put it elsewhere e.g. create a new project if folks desire.
http://code.google.com/p/inqle/source/browse/#svn/trunk/org.inqle.ui.google.widgets
Many thanks to Ivan Furnadjiev, for his energetic help in the development of these widgets! Thanks also to Christian Schmidt of Qooxdoo. Without their help I could have not gotten this working.
David Donohue