1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| <?php
include ("jpgraph-1.6.2/src/jpgraph.php");
include ("jpgraph-1.6.2/src/jpgraph_bar.php");
include ("jpgraph-1.6.2/src/jpgraph_line.php");
$datay1=array($delai_G1_tb);
$datay2=array($obje_G1_tb,$obje_G1_tb);
$width=500;
$height=250;
// Create the graph. These two calls are always required
$graph = new Graph($width,$height,"auto");
$left = 215;
$right = 215;
$top = -80;
$bottom = -110;
$graph->img->SetMargin($left,$right,$top,$bottom);
$graph->SetAngle(90);
$graph->SetScale("textlin",90,100,0,1);
$graph->SetShadow();
$graph->SetBox();
$graph->SetTickDensity(TICKD_VERYSPARSE);
$graph->title->Set("Example 24");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->Set("X-title");
$graph->xaxis->Hide();
$graph->yaxis->SetPos('max');
// Create the bar plots
$bplot = new BarPlot($datay1);
$bplot->SetFillColor("orange");
$bplot->SetAbsWidth(20);
$bplot->SetAlign(CENTER);
$bplot->SetYMin(90);
$bplot->value->Show(true);
$graph->Add($bplot);
// Create the line plots
$lplot = new LinePlot($datay2);
$lplot->SetColor("orange");
$lplot->SetWeight(4);
$graph->Add($lplot);
// Display the graph
$graph->Stroke();
?> |
Partager