<?php

include ("jpgraph/jpgraph.php");
include ("jpgraph/jpgraph_bar.php");

$data1y=array(-8,8,9,3,5,6);
$data2y=array(18,2,1,7,5,4);

$graph = new Graph(250,200,"auto"); 
$graph->SetFrame(true);
$graph->SetScale("textlin");
$graph->title->Set("Title");
$graph->title->SetFont(FF_TIMES,FS_BOLDITALIC,20);
$graph->title->SetColor(array(128,0,0));

$graph->xaxis->title->Set("x-title");
$graph->xaxis->title->SetFont(FF_ARIAL,FS_NORMAL,14);
$graph->xaxis->title->SetColor(array(0,64,128));

$graph->img->SetMargin(40,30,20,40);

$b1plot = new BarPlot($data1y);
$b1plot->SetFillColor("orange");
$b1plot->value->Show();
$b2plot = new BarPlot($data2y);
$b2plot->SetFillColor("blue");
$b2plot->value->Show();

$gbplot = new AccBarPlot(array($b1plot,$b2plot));

$graph->Add($gbplot);

$graph->Stroke();
?>