Static charts vs. interactive charts

March 2, 2010

I'm having my usual fun with charts. Working on mycheckpoint, I've generated monitoring charts using the Google Chars API. But I've also had chance to experiment and deploy interactive charts, JavaScript based. In particular, I used and tweaked dygraphs.

I'd like to note some differences in using charts of both kinds. And I think it makes a very big difference.

Static charts

I'll call any image-based chart by "static chart". It's just a static image. Example of such charts are those generated by Google Image Charts (they now also have new, interactive charts), or RRDtool. Show below is an example of a static chart; in this example, generated by Google:

Pros and cons of static charts

Pros

  • Images can be viewed on any graphical platform. Browsers, email clients, cell phones, whatever.
  • Self contained: chart image, legend, scales: all in one image.
  • As such, easy to move around.
  • Are safe to use.

Cons

  • Images are fuzzy. Is the com_replace_psec really 0? Maybe it's 0.1? A larger value can make lower values hard to tell.
  • Images are inaccurate: the colors can lie. The red and green lines showing are hard to tell apart. The red is painted above the green. Data gets "lost".
  • They do not zoom (one needs to regenerate larger image)
  • Unless encoded with base64, HTML pages which include images need to link outside.
  • In the particular case of Google Charts, one is limited to 2K length URL. Trust me, it's a big limitation! (PS, Google now support POST method to allow for up to 16K. But... it's a POST method...)
  • In the particular case of Google Charts, one must have an internet connection.
  • In the particular case of Google Charts, one must submit data to Google.

Interactive charts

Interactive charts are those which react to your commands. These are either JavaScript or Flash based, mostly. They allow for really nice features. Take the following chart as an example: try and move over with your mouse; or select sections to zoom in.


DML

[graphDiv]
[labelsDiv]

The above chart is generated with dygraphs. Since it is embedded within my WordPress page, the layout is affected by that of my theme. Take a look at this example page to see similar charts outside this blog site (Internet Explorer users: Maxmimize/minimize button will not work well for now. And, may I suggest Mozilla Firefox?)

Pros and cons of interactive charts

Pros

  • Can present you with exact values. No more doubt about the com_replace_psec values.
  • Can allow for zoom in, zoom out.

Cons

  • Need supporting platform. The above cannot be viewed by non-JavaScript browsers (cell phones, etc.)
  • Browser support is also an issue with JavaScript.
  • Emailing such report will result in mail blocking in many companies: mail filters will not allow for JavaScript code to pass.
  • Charts are not necessarily self-contained, in terms of the chart entity With Flash charts (e.g. Fusion Charts) this works. But in the above, the legend and scales are outside the image. As such, they cannot be just moved around.
  • HTML pages which include such charts can be self contained. The HTML page can include all the JavaScript dependencies, in addition to the chart generating code. Flash based charts cannot be self contained.

Summary

Interactive charts are cool!

I'm now integrating dygraphs into mycheckpoint (How nice it is to work with BSD & MIT licenses!). Though I may later switch to flot, interactive charts will be the next standard charting way in mycheckpoint. I will continue supporting static Google Charts, as follows from the above pros and cons list.

tags: , , , ,
posted in MySQL by shlomi

« | »

Follow comments via the RSS Feed | Leave a comment | Trackback URL

7 Comments to "Static charts vs. interactive charts"

  1. Roland Bouman wrote:

    Nice! I agree - interactive charts for world domination! keep it up :)

    Roland.

  2. shlomi wrote:

    Ronald,

    Will keep it up, to be sure.

  3. dygraphs JavaScript Visualization Library « Andreas Mauf wrote:

    [...] (via) [...]

  4. mycheckpoint (Rev. 118): alerts, email notifications and more | code.openark.org wrote:

    [...] Interactive charts. See my earlier post. [...]

  5. mycheckpoint (rev. 132): custom monitoring, custom charts, process list dump | code.openark.org wrote:

    [...] Interactive charts. See my earlier post. [...]

  6. mycheckpoint (rev. 170): improved custom queries; local charting; page/swap I/O monitoring; improved HTML reports | code.openark.org wrote:

    [...] Static charts vs. interactive charts [...]

  7. Ryan B wrote:

    Great post! I wish munin or cacti used dynamic charts. What would be even better is the ability to tack notes to specific points in the graph.

    So three months later when you are looking at a spike you can just rollover it to get a jolt to your memory. An SA can dream.

Leave Your Comment

 

 
Powered by Wordpress and MySQL. Theme by openark.org