[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/projectmanager/inc/jpgraph-1.5.2/src/Examples/ -> example16.1.php (source)

   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->img->SetMargin(40,130,20,40);
  14  $graph->SetScale("textlin");
  15  $graph->SetShadow();
  16  
  17  // Create the linear error plot
  18  $l1plot=new LinePlot($l1datay);
  19  $l1plot->SetColor("red");
  20  $l1plot->SetWeight(2);
  21  $l1plot->SetLegend("Prediction");
  22  
  23  // Create the bar plot
  24  $l2plot = new LinePlot($l2datay);
  25  $l2plot->SetFillColor("orange");
  26  $l2plot->SetLegend("Result");
  27  
  28  // Add the plots to the graph
  29  $graph->Add($l2plot);
  30  $graph->Add($l1plot);
  31  
  32  $graph->title->Set("Example 16.1");
  33  $graph->xaxis->title->Set("X-title");
  34  $graph->yaxis->title->Set("Y-title");
  35  
  36  $graph->title->SetFont(FF_FONT1,FS_BOLD);
  37  $graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
  38  $graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
  39  
  40  //$graph->xaxis->SetTickLabels($datax);
  41  //$graph->xaxis->SetTextTickInterval(2);
  42  
  43  // Display the graph
  44  $graph->Stroke();
  45  ?>


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7