GChart 2.5: Faster, Sharper, Canvas-rendered, Pie, Line, and Area Charts
John Gunther has released GChart 2.5, a client-side library that adds a new canvas-rendering option for sharper, better looking, alpha-transparent, pie, line, and area charts.
John told us:
“Canvas-rendering corrects GChart’s most serious visual quality limitations (including the most often mentioned problem by its users: the banded-filled pie slice).
Coupled with its existing feature set and ease of GWT integration, the canvas-rendering option makes GChart an excellent choice for those who want to add basic charts to a GWT application without a lot of fuss.
To access these features, you’ll need to plug an external canvas library into GChart (GWTCanvas in the gwt-incubator is reccommended) as described in detail in the setCanvasFactory method.
With the external canvas in place, the next step is to tell GChart you want a curve to be “continuously filled” by invoking setFillSpacing(0).
With each such continuously filled curve, GChart automatically exploits your external canvas library to improved the quality and speed of that curve’s rendering. Specifically, banded-filled pie slices become solid filled, dotted connecting lines become continuously connected, and (the biggest stretch) bar charts become area charts. See the setFillSpacing method’s javadocs for a detailed description of how each existing symbol type implements this new “continuously-filled”, canvas-powered, rendering option.
Note that GChart’s previous HTML-only rendering is still available, and is the default rendering mode if you don’t bother to plug in an external canvas.