<?php
require_once ('jpgraph/jpgraph.php');
require_once ('jpgraph/jpgraph_bar.php');
$datay=array(2,3,5,8,12,6,3);
$datax=array("320x240","640x480","600x800","1024x768","1280x1024(16)","1280x1024(32)",
"1600x1200(32)");
$width=300;
$height=400;
$graph = new Graph($width,$height,'auto');
$graph->SetScale("textlin");
$graph->SetFrame(false);
$graph->Set90AndMargin(100,20,50,30);
$graph->SetMarginColor('white');
$graph->SetBox();
$graph->SetBackgroundGradient('white','lightblue',GRAD_HOR,BGRAD_PLOT);
$graph->title->Set("Graphic card performance");
$graph->title->SetFont(FF_VERDANA,FS_BOLD,11);
$graph->subtitle->Set("(Non optimized)");
$graph->xaxis->SetTickLabels($datax);
$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,8);
$graph->xaxis->SetLabelMargin(10);
$graph->xaxis->SetLabelAlign('right','center');
$graph->yaxis->scale->SetGrace(20);
$graph->yaxis->Hide();
$bplot = new BarPlot($datay);
$bplot->SetShadow();
$bplot->SetFillGradient('darkred','yellow',GRAD_HOR);
$bplot->value->Show();
$bplot->value->SetFont(FF_ARIAL,FS_BOLD,10);
$bplot->value->SetColor("white");
$bplot->value->SetFormat('%.1f');
$bplot->SetValuePos('max');
$graph->Add($bplot);
$txt = new Text('Note: Higher value is better.');
$txt->SetPos(190,399,'center','bottom');
$txt->SetFont(FF_ARIAL,FS_NORMAL,8);
$graph->Add($txt);
$graph->Stroke();
?> |