[ 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.2.php (source)

   1  <?php
   2  include  ("../jpgraph.php");
   3  include  ("../jpgraph_line.php");
   4  include  ("../jpgraph_bar.php");
   5  
   6  $l1datay = array(11,9,2,4,3,13,17);
   7  $l2datay = array(23,12,5,19,17,10,15);
   8  $datax=array("Jan","Feb","Mar","Apr","May");
   9  
  10  // Create the graph. 
  11  $graph = new Graph(400,200,"auto");    
  12  $graph->img->SetMargin(40,130,20,40);
  13  $graph->SetScale("textlin");
  14  $graph->SetShadow();
  15  
  16  // Create the linear error plot
  17  $l1plot=new LinePlot($l1datay);
  18  $l1plot->SetColor("red");
  19  $l1plot->SetWeight(2);
  20  $l1plot->SetLegend("Prediction");
  21  
  22  // Create the bar plot
  23  $l2plot = new BarPlot($l2datay);
  24  $l2plot->SetFillColor("orange");
  25  $l2plot->SetLegend("Result");
  26  
  27  // Add the plots to the graph
  28  $graph->Add($l2plot);
  29  $graph->Add($l1plot);
  30  
  31  $graph->title->Set("Example 16.2");
  32  $graph->xaxis->title->Set("X-title");
  33  $graph->yaxis->title->Set("Y-title");
  34  
  35  $graph->title->SetFont(FF_FONT1,FS_BOLD);
  36  $graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
  37  $graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
  38  
  39  //$graph->xaxis->SetTickLabels($datax);
  40  //$graph->xaxis->SetTextTickInterval(2);
  41  
  42  // Display the graph
  43  $graph->Stroke();
  44  ?>


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