PHP Bar Graph / Bar Chart


This script allows you to create a simple dynamic horizontal PHP bar graph / bar chart from session data. With labels, colours, and many other customisable features. Great if you just want a simple PHP chart with no fuss.

Customisable Features:

  • Bar Colour
  • Bar Height
  • Grid Space
  • Title
  • Footer

The demo randomly customises itself, so refresh this page a few times to see what it can do.

Download PHP Source

DEMO:
PHP Bar Chart

If you use or modify the graph, please either email me about any modifications you make, or post a comment here with feedback about usability – bugs, feature requests etc, cheers :-)

Mega-Squall has modified the code to include two types of scaling; check it out @ http://ledry.free.fr/phpgraph/ – thanks!
(local copy here)

Bookmark and Share

, , ,

  1. #1 by Sean at May 5th, 2009

    Your script has one major downside that makes it pretty much unusable for most applications…. Have you tried to show maybe a figure of 25,000 for one of your bars and see how big the image gets?? Not sure a 2500pixel wide image is going to be ideal for a web page 1024 pixels wide huh ;) Otherwise good starting concept..

    • #2 by user24 at May 6th, 2009

      I believe Mega-Squall’s improved code deals with exactly that situation by allowing scaling of the graph ;)

(will not be published)
  1. No trackbacks yet.