[ Index ] |
|
Code source de jpGraph 2.2 |
1 <?php 2 include ("../jpgraph.php"); 3 include ("../jpgraph_line.php"); 4 include ("../jpgraph_error.php"); 5 include ("../jpgraph_bar.php"); 6 7 $l1datay = array(11,9,2,4,3,13,17); 8 $l2datay = array(23,12,5,19,17,10,15); 9 $datax=array("Jan","Feb","Mar","Apr","May"); 10 11 // Create the graph. 12 $graph = new Graph(400,200,"auto"); 13 $graph->SetScale("textlin"); 14 15 $graph->img->SetMargin(40,130,20,40); 16 $graph->SetShadow(); 17 18 // Create the linear error plot 19 $l1plot=new LinePlot($l1datay); 20 $l1plot->SetColor("red"); 21 $l1plot->SetWeight(2); 22 $l1plot->SetLegend("Prediction"); 23 24 // Create the bar plot 25 $l2plot = new LinePlot($l2datay); 26 $l2plot->SetFillColor("orange"); 27 $l2plot->SetLegend("Result"); 28 29 // Add the plots to the graph 30 $graph->Add($l2plot); 31 $graph->Add($l1plot); 32 33 $graph->title->Set("Mixing line and filled line"); 34 $graph->xaxis->title->Set("X-title"); 35 $graph->yaxis->title->Set("Y-title"); 36 37 $graph->title->SetFont(FF_FONT1,FS_BOLD); 38 $graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD); 39 $graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); 40 41 //$graph->xaxis->SetTickLabels($datax); 42 //$graph->xaxis->SetTextTickInterval(2); 43 44 // Display the graph 45 $graph->Stroke(); 46 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sat Nov 24 09:27:55 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |