I have been using javascript libraries for charting lately. I find it works well wil ajax / jQuery pages very well instead of flash because they share variables and functions.The best Open Source one I could find was Flot: http://code.google.com/p/flot/ The most obvious thing missing from it is a Pie chart which was added and updated in the forums of the project. The forums can be confusing, the files have been branched changed etc so many times and the thread style of the subject makes it very difficult. so here are the latest files I could gather that include pie, and my updates.

http://anthong.com/examples/flot.pie.zip

Updates include:

Border Layout for labels: The labels are optionally on the outside of the cart square with lines pointing to the respective slice.

Donut Hole: Optionally set an inner radius for a hollow center.

Hover in IE: IE support for flot requires excanvas: http://excanvas.sourceforge.net/ but excanvas does not support a function that makes the hover easy (isPointInPath) so I added a workaround.

I hope this helps, I may make a full project page out of ALL of the flot updates + examples.

enjoy,

Anthony

Share and Enjoy:
  • Digg
  • Technorati
  • Google Bookmarks
  • del.icio.us
  • Facebook
  • StumbleUpon
This entry was posted on Friday, July 31st, 2009 at 8:38 am and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

2 comments so far

Benjamin
 1 

Hi, Anthony.

It’s great to see the enhancement. But is there a plan to support the event notification when I hover over a pie piece or click a pie piece.

If that’s hard, the notification for click event on the words labeled to the piece can also help.

Thanks,
Benjamin

September 10th, 2009 at 8:06 am
admin
 2 

yes, hover on pie is supported, it’s one of the enhancements I had to come up with.

set grid:{hoverable:true}
and then bind a function to it like this: jQuery(“#chart”).bind(“plothover”, fnTooltip);

the click would be easy to adapt from the hover in the js code. clicking on the labels is not in there but would be easier to implement than the other 2 things you mentioned. But hovers already there so you should be good.

September 10th, 2009 at 10:05 am

Leave a reply

Name (*)
Mail (will not be published) (*)
URI
Comment