sloppycode.net
Graph class
Displays a simple table-based graph.
Home
›
Code snippets
›
PHP
›
Graph class
Download source + documentation
Graph class, for drawing simple html horizontal + vertical graphs The output works best on 5th generation browsers.
This class like all PHP classes on sloppycode.net was made in PHP 3.x or 4, so unfortunately isn't guaranteed to be error free anymore.
<? include_once("clsGraph.php"); $graph = new Graph(); $graph->barwidth = 25; $graph->defaultcolor = "blue"; $graph->maximum = 100; //$graph->orientation = "vertical"; //$graph->useborder = false; //$graph->usebarborder = false; $graph->add(25,"#ededed"); $graph->add(50,"#c9c9c9"); $graph->add(75,"#a5a5a5"); $graph->add(100,"#818181"); echo $graph->build(); echo "<BR>"; $graph->clear(); //$graph->orientation = "horizontal"; for ($i=1;$i <= 300;$i+=20) { $graph->add($i,"#AABBEE"); } echo $graph->build(); ?>
{Name}
Says:
{Date}
{Text}
› Home
› C#
› Snippets
› Articles
› Tools
› Taglines
› ASP
› Dictionary Object
› FSO
› Unix cheat sheet
› Gaming
› CSS
› Yak
› Umbraco
› About
› Contact
› Privacy
› Projects
› Search
› Sitemap
Buy on Amazon
Buy on Amazon
Buy on Amazon
Buy on Amazon