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

   1  <?php
   2  include  ("../jpgraph.php");
   3  include  ("../jpgraph_bar.php");
   4  
   5  $data1y=array(12,8,19,3,10,5);
   6  $data2y=array(8,2,11,7,14,4);
   7  
   8  $data3y=array(4,1,9,15,12,6);
   9  $data4y=array(8,3,2,1,9,10);
  10  
  11  // Create the graph. These two calls are always required
  12  $graph = new Graph(300,315,"auto");    
  13  $graph->img->SetMargin(40,30,20,40);
  14  $graph->SetScale("textlin");
  15  $graph->SetShadow();
  16  $graph->SetBox();
  17  $graph->SetTickDensity(TICKD_VERYSPARSE);
  18  
  19  // Create the bar plots
  20  $b1plot = new BarPlot($data1y);
  21  $b1plot->SetFillColor("orange");
  22  $b2plot = new BarPlot($data2y);
  23  $b2plot->SetFillColor("blue");
  24  
  25  $b3plot = new BarPlot($data3y);
  26  $b3plot->SetFillColor("green");
  27  $b4plot = new BarPlot($data4y);
  28  $b4plot->SetFillColor("red");
  29  
  30  // Create the accumulated bar plots
  31  $ab1plot = new AccBarPlot(array($b1plot,$b2plot));
  32  $ab2plot = new AccBarPlot(array($b3plot,$b4plot));
  33  
  34  // Create the grouped bar plot
  35  //$gbplot = new GroupBarPlot(array($ab1plot,$ab2plot));
  36  
  37  // ...and add it to the graPH
  38  //$graph->Add($gbplot);
  39  $graph->Add($b1plot);
  40  $graph->title->Set("Example 24");
  41  $graph->xaxis->title->Set("X-title");
  42  $graph->yaxis->title->Set("Y-title");
  43  
  44  $graph->title->SetFont(FF_FONT1,FS_BOLD);
  45  $graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
  46  $graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
  47  
  48  // Display the graph
  49  $graph->Stroke();
  50  ?>


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