DHTML / CSS based pie chart
This pie chart is done completely using DHTML and CSS! Unlike an applet based solution, this loads fast and blends in with the rest of the page. You can even use a transparent background for it!

This package now includes enhancements by Hendry Betts. "I removed your internal "fillArc" function and utilized the fillArc that is part of Walter Zorn's library. I also updated the script so that it could read the title provided and would display it. I further modified the script to allow the user to set the size of the pie chart however, if no size is provided, it defaults to 50% of the canvas' width. Lastly, I modified the Walter Zorn library to allow for the labels to be assigned an id so there could be an event listener attached to those components thus making them actionable. ". Thanks for the updates Henry!

This package is free software. It is distributed under GPL - legalese removed, it means that you can use this for any purpose, but cannot charge for this software. Any enhancements you make to this piece of code, should be made available free to the general public! You should also carry a link to this page for users to download the latest version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Note:To print the graph, the browser should have background enabled. See this thread for a JS solution: http://www.dynamicdrive.com/forums/archive/index.php/t-8475.html

Download the javascript code and support library .
Use View Source for an example.
The old code is available here: javascript code and support library .


Links
DHTML/CSS Bar Graph
DHTML/CSS Line Graph
Home