Open Flash Charts

I always admired open source development and open source developers and their attitude to give their best to world in every way they can. One such effort is Open Flash Charts by John Glazebrook.

Open Flash Chart is a library that provides cool flash charts for your web pages. It supports different charts type like line charts, bar charts, pie charts and many more. The installation and usage is admirably simple. The site provides nice demos, wrapper classes and code samples that you can use as head start.
To use open flash chart you just need to follow below steps –

  1. Download the latest OFC library from site download section
  2. Unzip the files and put it under your websites document root.
  3. Add few lines of codes in to your web page.
  4. Prepare and provide proper data paths for charts to be render and your done.

When you will visit your web page you can see the charts is on and working.

Let’s see how the code is added and how it will look like:

This is the code that you need to put in your web pages head element. This will render that chart in the element preferably DIV with id my_chart, and the data-file option to swfobject is the actual data for chart, you can see how the JSON data is generated using the helper classes available in the download section. You can see actual JSON data here

Here is some snippet of the code that generates JSON data. [Courtesy OFC Site]

Finally here is the end product –

ocfchart
This graph is click-able and it displays some nice tooltips when you take your mouse over the chart and data points.

P.S. If you don’t find the class graph in your downloaded files, please try searching this file in the previous version of the OFC because when I downloaded the charts library I couldn’t find the class graph, so I had to write my own wrapper and render classes. I will try and share those as time permits.

One Comment
  1. February 9, 2009 | Reply

Add a Comment

Your email address will not be published. Required fields are marked *