<?php
require_once ("jpgraph/jpgraph.php");
require_once ("jpgraph/jpgraph_line.php");
require_once ("jpgraph/jpgraph_plotline.php");
$datay1 = array(2,6,7,12,13,18);
$datay2 = array(5,12,12,19,25,20);
$graph = new Graph(350,200);
$graph->SetMargin(30,20,60,20);
$graph->SetMarginColor('white');
$graph->SetScale("linlin");
$graph->SetFrame(false);
$graph->title->Set("Using Builtin PlotMarks");
$graph->title->SetFont(FF_VERDANA,FS_BOLD,14);
Note:
$graph->tabtitle->Set('Region 1' );
$graph->tabtitle->SetWidth(TABTITLE_WIDTHFULL);
$graph->xgrid->Show();
$graph->xgrid->SetColor('gray@0.5');
$graph->ygrid->SetColor('gray@0.5');
$graph->legend->SetColor('navy');
$graph->legend->SetFillColor('lightgreen');
$graph->legend->SetLineWeight(1);
$graph->legend->SetFont(FF_ARIAL,FS_BOLD,8);
$graph->legend->SetShadow('gray@0.4',3);
$graph->legend->SetAbsPos(15,120,'right','bottom');
$l1 = new PlotLine(VERTICAL,3);
$l1->SetLegend('Key value');
$l1->SetWeight(2);
$graph->Add($l1);
$p1 = new LinePlot($datay1);
$p1->SetColor("red");
$p1->SetFillColor("yellow@0.5");
$p1->SetWeight(2);
$p1->mark->SetType(MARK_IMG_DIAMOND,5,0.6);
$p1->SetLegend('2006');
$graph->Add($p1);
$p2 = new LinePlot($datay2);
$p2->SetColor("darkgreen");
$p2->SetWeight(2);
$p2->SetLegend('2001');
$p2->mark->SetType(MARK_IMG_MBALL,'red');
$graph->Add($p2);
$graph->Stroke();
?> |