views:

2254

answers:

11

I'm trying to find a good Graph drawing library for my PHP application. Currently I am limited to viewing the data in a table which while specific, is a bit ugly.

I require a non-flash system if possible.

+11  A: 

I had this similar problem a month ago and ended up going for Google Charts. It's extremely fast, very powerful (only one or two features I've wanted have been missing and they weren't a big deal) and things like the 3D pie charts add instant visual appeal.

There is at least one wrapper called Gphpchart but it looks like their site has currently been hacked (sigh) so don't go clicking on any of the links until it gets fixed or restored.

I found a couple of relevant questions about this:

cletus
I second that. Google Charts is very easy and quick to implement in any web language.
Bob Somers
Google charts is very nice, although building the urls can sometimes be rather difficuilt.
Pim Jager
@Pim: that's why you use Gphpchart or another wrapper.
cletus
Remember that Google Chart's EULA requires the thing using the API to be publicly available. So, for example, you can't use the charts in a closed-community software. Or, this was the case at least a few months ago - don't know if they have changed it since. You better check.
Henrik Paul
3d pies? come on! that's an abomination.
Eduardo Leoni
+5  A: 

You might be interested in Open Flash Chart 2 - the flash charting engine used by Piwik:

May not be suitable for print purposes - to be honest I haven't checked whether Flash prints or not!

If you need to output to images rather than Flash, JpGraph might be worth a look too:

(JpGraph may have some functionality only available in "pro" version)

Chris Burgess
A: 

Open Flash Chart would be my recommendation, as well. Another good one is amCharts. Unfortunately, both of these are Flash-based charts.

Stephen
+1  A: 

All I've used under PHP is ChartDirector, which seems like it has to be getting a little long in the tooth, but I was pretty happy with it.

chaos
+1  A: 

It might be worthwhile to continue outputting the data as a table, and using javascript on the client to convert the table to a chart.

There's at least one good javascript package for this that I've used http://code.google.com/p/flot/ , and I'm sure there's some alternatives if that one doesn't cut it for your specific needs.

+15  A: 

pChart is a relatively new PHP library that creates great looking (non-flash) charts.

Bill Zeller
Those charts look great better than some flash charts i've seen, on the face of it this looks fantastic. Thanks
Jonathan
Beautiful charts. It is open source under GPL which might be relevant if you need to distribute your website to others.
MarkJ
A: 

I'd like to cast an additional vote for Google Charts. Having lots of experience with other Google API's the charting API was amazingly simple and we've started integrating into many of our internal applications as well.

jerebear
+2  A: 

I just bookmarked a php chart library the other day. Good timing. :)

The graphs are some of the most beautiful I've seen available for free. I always found Google Charts kind of bland. pChart can be beautiful, but the learning curve is steeper. Still shouldn't be too steep.

sjstrutt
+4  A: 

I found Flot (http://code.google.com/p/flot/) to be really simple and useful. Has much more flexibility that Google Charts.

A: 

JPGraph is a comprehensive solution, and there is a free version that you can use. This tutorial shows you how to get started with JPGraph and PHP.

Phyxx
A: 

Probably not what you are looking for, but I have recently done some work on a framework for producing 2D charts allowing for live updates at a rate of over 50 changes per second.

The original intention was to mimic the appearance of a chart recorder in a scrolling region of a web page, but I believe the approach has wider application.

An demo can be found at Chart Recorder Demo if anyone is interested.

The appearance is defined by a template (www.journeylog.co.uk/chart/templates/chartRecorder.xml). One feature is the ability to specify drawing either on the server or in the browser using ExplorerCanvas.

If anyone is interested I could start an open source project for it.

mayfly