Chris Mitchell of IBM had a few days of free time prior to the Dojo 1.0 release, and so he added Canvas support for dojox.gfx. While Canvas does not offer all of the DOM goodness of SVG, it does have one key features: it works today on the iPhone. While we expect the iPhone’s version of Safari to be updated to support SVG for vector graphics and charting very soon, it allows us to draw and chart natively on the iPhone now:
To include a chart in your Dojo app, first require the following modules:
And then in your HTML body, include a widget with the right parameters:
dojox.gfx now includes support for SVG, VML, Canvas, and Silverlight through one simple, SVG-inspired 2-D and 3-D drawing API!