Monday, October 29th, 2007
GChart: GWT charts without JSNI, plugins, or server round-trips
John C. Gunther is building a technical computing application that generates all of the data that it charts via client-side computations. He didn't want to create the charts on the server side, and decided to use GWT to do the work for him.
This is how he created GChart.
To see it at work, check out the chart gallery that has examples such as:
-
-
package com.googlecode.gchartdemo.client;
-
import com.googlecode.gchart.client.GChart;
-
/**
-
* Defines a scatter-plot of x*x vs. x.
-
*/
-
public class GChartExample00 extends GChart {
-
GChartExample00() {
-
setChartTitle("<b>x<sup>2</sup> vs x</b>");
-
setChartSize(150, 150);
-
addCurve();
-
for (int i = 0; i <10; i++)
-
getCurve().addPoint(i,i*i);
-
getCurve().setLegendLabel("x<sup>2");
-
getXAxis().setAxisLabel("x");
-
getYAxis().setAxisLabel("x<sup>2</sup>");
-
update();
-
}
-
}
-
Which creates:

For other graphing needs check out Plotkit and Dojo Charting.












Hey Dion,
Thanks for the link to dojo.charting. For those who are wondering about Dojo charting on the 0.9+ versions, here’s a peek at the awesome work Eugene Lazutkin has been cooking up for 1.0:
http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/charting/tests/
Regards
Thanks for the article–GChart got more visits from Ajaxian than from any other site!
As Tahir
Akhtar pointed out on the GWT forum, GChart’s site
originally lacked a live demo. No longer. Click on the
bar chart image on GChart’s home page
to open it up into a real-live GChart.