HTML_Graphs uses PHP to provide a nice class interface for html graphs. It provides a single, reasonably consistent interface for creating HTML based charts. The idea behind this code is that the user of the class sets up four or five arrays and pass these to html_graph() which then takes care of all the messy HTML layout. A fully customized chart can be created in just five lines of PHP code.

You may download the source code for HTML_Graphs.php3 which also includes the source for this page that contains comments to help you get HTML_Graphs up and running. I hope you find it useful. If you have questions, suggestions, bugs, bug fixes, or enhancements please send them to pdavis@pobox.com so that they may be wrapped into future versions of HTML_Graphs.

The following are just a few examples of the customability that HTML_Graphs offers.

Favorite Fast Food Genre

# of Votes
F
o
o
d

T
y
p
e

Pizza (2330)
Hamburger (780)
Chinese (1382)
Subs (612)
Other (501)

Favorite Sci Fi TV Show

TV Show
#

o
f

V
o
t
e
s

(1781)
(138)
(358)
(373)
(1651)
(282)
(1025)
Bab5 Earth: Final Conflict DS9 Voyager X-Files Other They All Suck

Unit Sales/Cost

Units Sold/Dollars
P
r
o
d
u
c
t

C
o
d
e

PE-123
(24)
(167.28)
PE-001
(24)
(191.28)
PE-231
(24)
(186)
PE-221
(48)
(297.6)
PE-667
(1)
(334)
PE-876
(16)
(356.4)
PE-392
(17)
(26.5)
PE-192
(1)
(26.5)
PE-741
(1)
(23.5)
PE-357
(1)
(23.5)
PE-353
(1)
(222.04)
PE-998
(26)
(58.56)
PE-342
(48)
(98.54)

All Defaults

PE-221 (24)
PE-667 (24)
PE-876 (24)
PE-392 (48)
PE-192 (1)
PE-741 (16)
PE-357 (17)
PE-353 (1)
PE-998 (26)
PE-342 (48)

Complex Graph

Mustang Taurus
Corvette Lumina
Mustang Taurus
Corvette Lumina
1995 1997

Favorite SouthPark Character

# of Votes
C
h
a
r
a
c
t
e
r
Kenny (842)
Cartman
 
(1675)
Stan (218)
Kyle
 
(246)
Chef (906)
Big Gay Al
 
(1425)
Jesus (520)
Mr. Garrison
 
(137)
Wendy (96)
Pip
 
(111)

Favorite Actors Ranked

Actors/Years
R
a
n
k
(1)
(4)
(2)
(1)
(3)
(5)
(4)
(2)
(5)
(3)
Clint Eastwood Mel Gibson Tom Cruise John Wayne Harrison Ford
- 1996
- 1997


Back to Phil's homepage.