dojox/charting - notes

Notes on using dojox Charting.

  • Read the documention at the link above.
  • Assemble the page as AJAX from the beginning. Don’t bother building an HTML version first, the number of requests required for charting is large enough that these pages should be AJAX pages. Zend Framework’s Dojo Data (http://framework.zend.com/manual/en/zend.dojo.data.html) component is an excellent way to encode the data for transport. Zend Framework can be used as a library.
  • Consider using a pulldown to allow the viewer to select the theme used. This is nice for appearance and fun, but may also be valuable for people that have difficulty distinguising colors. A simple loop that lists the available themes, uses a dojo.require to fetch the code, and then applies them to the charts and legends with chart.SetTheme, chart.render, and legend.refresh is a nice feature.
  • Think carefully about what charts you’d like to use. This link
    http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/charting/tests/test_chart2d.html has great sample code. Take the time to look at the charts available. Moving up a level or two in the directory tree yields additional, valuable code.
  • Use updateSeries if possible to redraw charts, if necessary, use destroy, then recreate them.
  • Offer good explanatory text to help people interpret the displays.
  • Write the queries carefully, it’s often faster to query, then use arithmetic to find out other portions of the data. Don’t forget to fill in gaps of missing data for series that illustrate usage or events across time spans.
  • Be sure to sanitize and validate the data. Always.