I would like to be able to create a pie chart in PHP. Are there any libraries that will allow me to easily create a pie chart from a list of names and percentages?
If you don't want external images, have a look at php's gd functions. You will probably have to code the pie chart function yourself, but it should fit in 1-2 pages of code and there are lots of examples out there.
There are several librarys:
These three are just some of them, and they are free:
- XML/SWF Charts - nice Flash diagrams -> puts load of drawing to the client and looks nice!
- PHP Chart Library - Doesn't look so nice, but calculates charts on the server
- YUI! - Not specifically for PHP, but nice to wirk with.
Personally I'm using YUI at the moment, but I haven't tried to create pie charts with it. Just line graphs.
(I don't like to use Google for that. They already have enough information about everything. And if they decide to close down their service: You're stuck ;) )
I agree with Keith. The Google Charts API is fantastic. I've never actually used it for pie charts, but for many other types of graphs it was fast, simple and looked fantastic.
I had never even heard of google charts api...and I should, since I love google. I will look into this some more tonight, Thanks guys!
PHP installs comes with a default chart library, GD.
phpinfo();
to see if it's supported.