Drawing charts

Charts are helpful when working with numbers. Some service providers let you see statistical reports but often the graphical representations are either incomplete or too scattered between different pages and hard to compare.

In the past week I spent a couple of days looking at some user submitted data and comparing it to some numbers about ads. I started by loading the CSV files I downloaded and parsing them into Python objects.

Producing charts directly with Python was a bit of a challenge, I located some open source projects some of which didn't appear to have been recently updated. I did try to use them, but maybe simply because of my flaky network connection I didn't get anywhere with them after spending the better part of a day at it.

In the end I realized that if I were to output the parsed data in CSV I can easily create the charts by loading the files in Google Docs. Unfortunately a couple of our clients have had some issues accessing Google Docs. Plus Google Docs appears to have very limited control over the chart style, so I ended up using Oracle's Open Office. I was able to export the charts into a PDF.

Having to manually generate the charts using a desktop app is anathema to me so I remembered that being able to export rows of numbers in CSV is pretty close to dumping JSON and remembering gRaphael I realized that there may yet be a way to automate everything and allow for programmatic control over the reports.

Fortunately for me Google brought up some posts comparing a number of JavaScript chart libraries related to gRaphael. I'm about to build a simple test case for a library called Flot that appears to have the lead in the open source offerings. I'm staying away from proprietary libraries for now but some commercial applications may allow for it.

Well that's all for now, the next post will probably deal with my exploration of Flot and hopefully some code and images.

Posted