<?php
$Id: horizbarex4.php,v 1.4 2002/11/17 23:59:27 aditus Exp $
require_once ('jpgraph/jpgraph.php');
require_once ('jpgraph/jpgraph_bar.php');
$datay=array(1992,1993,1995,1996,1997,1998,2001);
$width=400;
$height=500;
$graph = new Graph($width,$height);
$graph->SetScale('textlin');
$top = 60;
$bottom = 30;
$left = 80;
$right = 30;
$graph->Set90AndMargin($left,$right,$top,$bottom);
$graph->SetShadow();
$lbl = array("Andrew\nTait","Thomas\nAnderssen","Kevin\nSpacey","Nick\nDavidsson",
"David\nLindquist","Jason\nTait","Lorin\nPersson");
$graph->xaxis->SetTickLabels($lbl);
$graph->xaxis->SetLabelAlign('right','center','right');
$graph->yaxis->SetLabelAlign('center','bottom');
$graph->title->Set('Number of incidents');
$bplot = new BarPlot($datay);
$bplot->SetFillColor('orange');
$bplot->SetWidth(0.5);
$bplot->SetYMin(1990);
$graph->Add($bplot);
$graph->Stroke();
?> |