<?php
include("jpgraph/jpgraph.php");
include("jpgraph/jpgraph_line.php");
$ydata = array(5,10,15,20,15,10,8,7,4,10,5);
$graph= new Graph(400,300);
$graph->SetScale("textlin");
$graph->SetShadow(true);
$graph->SetMarginColor("lightblue");
$graph->legend->SetFillColor("antiquewhite");
$graph->legend->SetShadow(true);
$graph->title->Set("Filled Area Example");
$graph->title->SetFont(FF_FONT2,FS_BOLD);
$lineplot = new LinePlot($ydata);
$lineplot->SetLegend("Semi-filled\nLineplot");
$lineplot->SetColor("black");
$lineplot->AddArea(2,5,LP_AREA_FILLED,"red");
$lineplot->AddArea(6,8,LP_AREA_FILLED,"green");
$lineplot->mark->SetType(MARK_DIAMOND);
$lineplot->mark->SetSize(8);
$lineplot->mark->Show();
$graph->Add($lineplot);
$graph->Stroke();
?> |