<?php
include
(
"src/jpgraph.php"
);
include
(
"src/jpgraph_bar.php"
);
include
(
"src/jpgraph_line.php"
);
$graph
=
new
Graph(400,200,
"auto"
);
$graph
->SetScale(
"textlin"
);
$graph
->img->SetMargin(40,180,40,40);
$graph
->SetBackgroundImage(
"abc.jpg"
,BGIMG_FILLPLOT);
$graph
->img->SetAngle(45);
$graph
->AdjBackgroundImage(0,0);
$graph
->title->Set(
"test image"
);
$graph
->title->SetFont(FF_FONT1,FS_BOLD);
$graph
->title->SetMargin(3);
$graph
->legend->Pos(0.05,0.5,
"right"
,
"center"
);
$graph
->legend->SetShadow('darkgray@0.1');
$graph
->legend->SetFillColor('lightblue@0.3');
$graph
->xaxis->SetTickLabels(
$label_x
);
$graph
->xaxis->SetLabelAngle(30);
$graph
->xaxis->title->Set('Year 2006');
$graph
->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph
->xaxis->title->SetColor('white');
$graph
->xaxis->SetFont(FF_FONT1,FS_BOLD);
$graph
->xaxis->SetColor('yellow');
$graph
->yaxis->SetFont(FF_FONT1,FS_BOLD);
$graph
->yaxis->SetColor('yellow');
$graph
->ygrid->SetColor('yellow@0.5');
$graph
->yaxis->scale->SetGrace(20);
$bplot1
=
new
BarPlot(
$datay1
);
$bplot2
=
new
BarPlot(
$datay2
);
$bplot1
->SetFillColor('orange@0.4');
$bplot2
->SetFillColor('brown@0.4');
$bplot1
->value->SetFormat('%d');
$bplot1
->SetLegend('Label 1');
$bplot2
->SetLegend('Label 2');
$bplot1
->SetShadow('black@0.4');
$bplot2
->SetShadow('black@0.4');
$gbarplot
=
new
GroupBarPlot(
array
(
$bplot1
,
$bplot2
));
$gbarplot
->SetWidth(0.9);
$graph
->Add(
$gbarplot
);
$graph
->Stroke();
$p1
=
new
LinePlot(
$datay
);
$p1
->mark->SetType(MARK_FILLEDCIRCLE);
$p1
->mark->SetFillColor(
"red"
);
$p1
->mark->SetWidth(4);
$p1
->SetColor(
"blue"
);
$p1
->SetCenter();
$p1
->SetLegend(
"Triumph Tiger -98"
);
$graph
->Add(
$p1
);
$p2
=
new
LinePlot(
$data2y
);
$p2
->mark->SetType(MARK_STAR);
$p2
->mark->SetFillColor(
"red"
);
$p2
->mark->SetWidth(4);
$p2
->SetColor(
"red"
);
$p2
->SetCenter();
$p2
->SetLegend(
"New tiger -99"
);
$graph
->Add(
$p2
);
$lineplot
->SetStyle(
"dashed"
);
$graph
->yaxis->scale->SetGrace(20);
?>