skip to the main content area of this page
In Appreciation of Open Flash Chart

OFC-Modified - My Story

OFC-Modified Logo

FWIW: This is the explanation from my original web-site that I made back in August(?) 2008 to present my enhancements to monk.e.boy to see if there was a way we could merge our work. (with one edit to remove big chart example pop up)

I needed to enhance some charts that plotted thousands of data points along a time line. I tested Fusion Charts which looked good but I ran into a problem with large data sets. The flash player would break after every 15 seconds of processing and ask if the movie should be terminated. Reading through their forum, I learned that they only recommend around 5000 points and did not seem to be interested in changing their approach. The source code was available but the price was beyond what we were willing to pay (and then still have to modify).

I then stumbled upon Open Flash Chart which also looked good, had been converted to be built with open source tools and the source code was freely available. Awesome! I downloaded rev # 178 and after looking at the source code and reading through the forum, I determined that it would be a while before OFC1 was fully implemented into OFC2 and it appeared that the JSON file format was still in flux. The main chart that I needed was a scatter chart with connecting lines that was not yet available and of course the handling of the large data set (OFC has the same problem if it takes longer than 15 seconds to load the data). I decided to jump into learning flash and AS3 to see what I could do since I was on a tight schedule to get the charts working.

I'm afraid that the source code is organized differently than the OFC code and that I diverged a bit from the OFC JSON file format since there were quite a few things I wanted to do differently after I got into it and figured out how things worked. If you like my approach that is great but if not then that is okay also and maybe there are some things from it that can be used in OFC.

I was mainly interested in a scatter line chart so that is where I started. At the moment it is the only line chart type since I figured if anyone was going to have to change their code to use this version, then they could supply an "x" and a "y" instead of just the "y" value. It should be easy to create a simple line chart type that inserts the "x" value if needed. Instead of having a different line chart for each element type, I made an anchor element that is configurable as to whether it is a dot, a circle, a hollow circle or a n-sided object. Each point on the line can be a different type if desired.

My other large hurdle was the problem with the large data sets. Fortunately, OFC had a cool spinner for a loading page that would keep the user happy while waiting for the data set to load if I could figure out a way to keep it spinning. I changed how data gets loaded so that it is done with a timer. Each time the timer kicks off, 100 points of data are processed and then it sets a timer to kick off again for the next 100 points. This gives flash time to bump the spinner another notch so that it thinks the movie is advancing instead of hanging.

After getting the scatter line chart working, I implemented the pie charts which I also needed into the new framework. I managed to get those two charts working within my deadline since I was able to devote my entire time to it. After that the job wasn't so keen on letting me complete the implementation of the other charts on their time so I had to do it on my own time and development slowed down. (My hat is off to you monk.e.boy - I can't imagine the time you have put into OFC plus having tons of support questions on the forums!) I finally have most of the charts implemented in this different framework except for the stacked bar chart. I haven't been keeping up with all of the changes OFC has been making so there are probably other advancements that I missed. I know that I have not done anything along the line of the realtime updates since I don't use that.

List of Enhancements

Here is at least a partial list of modifications I have made that you might be interested in (some of these may have been implemented in OFC since rev 178):

Line Charts

  • Scatter Line charts
  • Configurable points (anchors): dot, circle, triangle, square, pentagon, etc.
  • New animation when displaying the line chart
  • Gaps in line charts (add a point with "visible"=false)
  • Automatic colors: if no color specified then 1 of 30 colors is used for the series
  • Areas optionally filled: base can be a x or y line or a (x,y) point


  • Tooltips

  • Changed the way tooltips are handled due to large data sets
  • Tooltips are configurable on a per series basis
  • Tooltips can use the color of the series for background or text color
  • Tooltips can be set/overridden at chart/series/point levels


  • Legend

  • Legend can be placed on the right side as well as top
  • Legend text entries can be in the color of its series


  • Axes and Grid Lines

  • Using lines instead of filled rectangles for axis and grid lines
  • User defined and fixed number of grid lines as well as steps
  • Grid lines and tic marks can be visible or not
  • Rotated labels: any angle -180 to 180
  • Ability to draw top and right lines that match the axis line
  • Right side Y-Axis
  • PHP date type can be used as values with date formatting "magic" values
  • Labels as well as Tooltips can use "magic" values
  • Labels can be individually configured (user defined grid lines)


  • Pie Charts

  • New animation when highlighting a slice
  • Automatic colors for slices
  • Labels adjust better to not overlap
  • Labels can be visible or not
  • Legend works with pie charts also
  • Pie Charts can be combined with other chart types (don't know why you would...)


  • Bar Charts

  • Each bar is individually configurable for type/color
  • New animation when displaying the bars
  • Candlesticks default to red/green and are configurable


  • Infrastructure

  • Repackaged as com.ofc.xxxx
      (wanted to change main to only get the JSON data and then create an OFCChart object but never got to it)
  • Timer based loading of data to handle large amounts of data
  • Scatter chart is now the basis for charts
  • Using constants to minimize chance of typos for JSON properties
  • Style property wrapped in an Attributes object
  • Axis Labels and Title are children of the Axis
  • Unified Line and Pie chart processing in main
  • Single Anchor element is configurable as to type
  • Single Bar (& HBar) element is configurable as to type
  • Test for closest point only looks at 5 closest values
  • JSON deserialization now accepts numbers in exponential notation
  • JSON deserialization now allows a comma after final element of objects and arrays
  • mergeProps was changed to copy objects instead of referencing them
  • ToolTip now handles (un)highlighting selected element
  • ToolTip defaults to "follow" since "closest" is impractical for large data sets
  • Various defaults were changed to the values I wanted (sorry :-)