<?php 
require_once ("jpgraph/jpgraph.php");
require_once ("jpgraph/jpgraph_bar.php");
require_once ("jpgraph/jpgraph_line.php");
 
$ydata  = array(10,120,80,190,260,170,60,40,20,230);
$ydata2 = array(10,70,40,120,200,60,80,40,20,5);
 
$months = $gDateLocale->GetShortMonth();
 
$graph = new Graph(300,200);    
$graph->SetScale("textlin");
$graph->SetMarginColor('white');
 
$graph->SetMargin(30,1,20,5);
 
$graph->SetBox(); 
 
$graph->SetFrame(false);
 
$graph->tabtitle->Set('Year 2003');
$graph->tabtitle->SetFont(FF_ARIAL,FS_BOLD,10);
 
$graph->ygrid->SetFill(true,'#DDDDDD@0.5','#BBBBBB@0.5');
$graph->ygrid->SetLineStyle('dashed');
$graph->ygrid->SetColor('gray');
$graph->xgrid->Show();
$graph->xgrid->SetLineStyle('dashed');
$graph->xgrid->SetColor('gray');
 
$graph->xaxis->SetTickLabels($months);
$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,8);
$graph->xaxis->SetLabelAngle(45);
 
$bplot = new BarPlot($ydata);
$bplot->SetWidth(0.6);
$fcol='#440000';
$tcol='#FF9090';
 
$bplot->SetFillGradient($fcol,$tcol,GRAD_LEFT_REFLECTION);
 
$bplot->SetWeight(0);
 
$graph->Add($bplot);
 
$lplot = new LinePlot($ydata2);
$lplot->SetFillColor('skyblue@0.5');
$lplot->SetColor('navy@0.7');
$lplot->SetBarCenter();
 
$lplot->mark->SetType(MARK_SQUARE);
$lplot->mark->SetColor('blue@0.5');
$lplot->mark->SetFillColor('lightblue');
$lplot->mark->SetSize(6);
 
$graph->Add($lplot);
 
$graph->Stroke();
?> |