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
|
<?php
include ("/var/www/html/lib/jpgraph-2.1.3/src/jpgraph.php");
include ("/var/www/html/lib/jpgraph-2.1.3/src/jpgraph_line.php");
//Mes données
$xdata = array(1,2,3,4,5,6,7,8,9,10);
$ydata = array(1,5,8,22,24,45,68,78,85,97);
$y2data = array(10,3,3.5,2,1,0.1,3,2,2.5,7);
$graph = new Graph(400,300);
$graph->SetScale("textlin",0,100);
//$graph->yscale->ticks->Set(2,0.5);
//$graph->yscale->SetAutoTicks(); //tick automatique
$graph->title->Set('Graphique de test');
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Courbe1
$line = new LinePlot($ydata);
$line->SetColor("green");
$graph->Add($line);
// Courbe2
$line2 = new LinePlot($y2data);
$line2->SetColor("red");
$graph->Add($line2);
// Output graph
$graph->Stroke();
?> |
Partager