<?php
require_once ('jpgraph/jpgraph.php');
require_once ('jpgraph/jpgraph_bar.php');
$datay=array(0.13,0.25,0.21,0.35,0.31,0.06);
$datax=array("January","February","March","April","May","June");
$graph = new Graph(400,240);
$graph->img->SetMargin(60,20,35,75);
$graph->SetScale("textlin");
$graph->SetMarginColor("lightblue:1.1");
$graph->SetShadow();
$graph->title->Set("Bar gradient with left reflection");
$graph->title->SetMargin(8);
$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
$graph->title->SetColor("darkred");
$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10);
$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,10);
$graph->yscale->ticks->SupressZeroLabel(false);
$graph->xaxis->SetTickLabels($datax);
$graph->xaxis->SetLabelAngle(50);
$bplot = new BarPlot($datay);
$bplot->SetWidth(0.6);
$bplot->SetFillGradient("navy:0.9","navy:1.85",GRAD_LEFT_REFLECTION);
$bplot->SetColor("white");
$graph->Add($bplot);
$graph->Stroke();
?> |