PHP Graphing Library

I recently did search for an open source PHP graphing library. Besides the well known but non-free JpGraph library, I found many simple ones either for bar graphs or pie graphs. Until I stumbled across Zack Bloom's Advanced Graphing Class. It does pie, line and bar graphs including function plotting and has a plethora of options to set. Most notably is it's ability to autoscale graphs depending on the input data.

Unfortunatly it was only available for PHP5. I'm still running PHP4 and many others do as well, so I ripped out all PHP5 syntax and made it run on PHP4. I also removed the capability to output JavaScript graphs instead of images, because I didn't need this feature. The library is licensed to the public domain, but comes with an Arial truetype font. I wasn't sure about the license of that font so I replaced it with the really free Bitstream Vera font.

If you need a graphing lib for PHP4 you can download it or do a darcs checkout. Maybe someone could use this lib for a nice DokuWiki plugin?

Tags:
php,
graph
Similar posts:

 
Posted on Saturday October the 7th, 2006 (22 months ago).

Comments

1
Wow, cool! After I have updated my existing plugins, I will definitely have a look at it!
2006-10-07 21:30:01
Esther Brunner
2
This is interesting you are creative, just stambled on your blogs while getting an update for DokuWiki <loving it!>

Did you try js-graph? I am not sure, without checkingm but I have bundled it with dotproject to get some neat reports and gnatt graphs.

What does JavaScript do to graphs that you did not need? Or better what did you need? :-)

regards, LA-K
2006-10-20 09:32:19
Leslie Asamoa
3
Hey, This is Zack Bloom (creator of the PHP graphing class).  I just wanted to thank you for creating a PHP4 version of the class.  I considered doing it myself, but PHP5 adoption is on the rise (for good reason) so I opted not to.  Do you have any feature requests?
2006-10-24 17:47:15
Zack Bloom
4
Fantastic, just what I was looking for.

Daniel
www.hostingme.co.uk
2007-03-15 22:15:25
5
wow - those zack bloom graphs are awesome.  but my webserver is running php 4 still, so thanks a lot!  this is just what i need.
2007-03-28 11:43:38
justinf
6
i haven't tried yet though but I'm hearing a lot of good things bout this so ill try this. i only have a trouble though, i don't know where to download that PHP5 compatible lib. it seems i cannot get into zack's place. never the less, ill try that PHP4 compatible lib.
2007-09-29 10:34:08
bluejay
7
Since this entry is #2 on a google search for "php graphing" I think his site might have got the /. effect :(
2007-10-02 00:08:29
Toby
8
Can you upload the original (PHP5) code somewhere? I've been trying to get a copy of it but his website is down.

Thanks!
2007-10-17 07:55:53
Original Code?
9
Zack's site seems to be gone forever. Unfortunately I do not have Zack's original download package anymore. But I was able to find some sources at the archives of the Wayback Machine.

I zipped up all I could find and made it available for download here: http://www.splitbrain.org/_med … /graph.zip

Note: the code in this zip file is completely untested and might be broken. You're on your own with it.

Maybe someone would step up and adopt Zack's project?
2007-10-17 21:14:38
10
Thanks Andi, that has all of the examples so was at least more complete than the version I found at phpclasses. Now I can understand what he is talking about in the readme w/o having to make the mysql tables and such just to test it :)
2007-10-18 06:51:16
John
11
This will save me tones of money and time this is absoultly amazing.
2007-11-10 21:09:27
Austin
12
There seems to be a bug using  setProperty("scale","date");

It never shows October no matter what I do. Anyone else seen this problem?
2007-12-05 06:23:24
13
I'm having a problem with using both axis labels and the key... the axis labels are overwritten by the key and the image doesn't resize correctly... been trying to hack on it for awhile now.

Also I was having a problem where manually setting the y axis values caused no lines to be drawn *ugh*! I had to create an invisible one which is a bit higher and lower than the min/max values to add some padding.

The date function is what is the best thing though, as its much more useful than other free graphing libraries.
2007-12-08 01:23:18
John
14
I fixed the problem where the key would not take the correct size of the image after it was resized.

By this:
if ($this->getProp("showkey",false)) {
///////
Replace:
$acthei = $this->getProp("actheight",$this->height);
$actwid = $this->getProp("actwidth",$this->width);
///////
With:
$acthei = imagesy($this->img);
$actwid = imagesx($this->img);
///////

$this->width and $this->width are not updated all the time from what I can tell, so its better to just get the new values.

Hope that helps someone else!
2007-12-08 06:40:00
John
15
Just what i was looking for as i am also running PHP4.

Thank you
2008-01-16 11:26:56
CAPTCHA

No HTML allowed. URLs will be linked with nofollow attribute. Whitespace is preserved.

 
 

Blog

Older Weblog articles are available in the Archive, subscribe to the
Full Content RSS Feed
to stay tuned. (learn more)

Subscribe to the Feed

Recent Blog Entries

 

This is the personal web site of Andreas Gohr - human being, blogger and web geek from Berlin, Germany.

This page was last updated at 2006/10/08 20:44.
Imprint/Impressum

Tagged at del.icio.us:

Bookmarks: 3

View blog reactions

Recent readers: