[ Index ]
 

Code source de jpGraph 2.2

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/src/Examples/ -> negbarvalueex01.php (source)

   1  <?php
   2  include  ("../jpgraph.php");
   3  include  ("../jpgraph_bar.php");
   4  
   5  $datay=array(12,0,-19,-7,17,-6);
   6  
   7  // Create the graph. 
   8  $graph = new Graph(400,300,"auto");    
   9  $graph->img->SetMargin(60,30,40,40);
  10  $graph->SetScale("textlin");
  11  $graph->SetShadow();
  12  
  13  // Create a bar pot
  14  $bplot = new BarPlot($datay);
  15  $bplot->SetFillColor("orange");
  16  
  17  // DIsplay value at top of each bar
  18  $bplot->value->Show();
  19  $bplot->SetShadow();
  20  
  21  $graph->Add($bplot);
  22  
  23  // Position the scale at the min of the other axis
  24  $graph->xaxis->SetPos("min");
  25  
  26  // Add 10% more space at top and bottom of graph
  27  $graph->yscale->SetGrace(10,10);
  28  
  29  $graph->xaxis->title->Set("X-title");
  30  $graph->yaxis->title->Set("Y-title");
  31  
  32  $graph->title->SetFont(FF_VERDANA,FS_NORMAL,12);
  33  $graph->title->Set("Example of bar plot with absolute labels");
  34  
  35  $graph->yaxis->title->SetFont(FF_ARIAL,FS_NORMAL,16);
  36  
  37  
  38  $graph->Stroke();
  39  ?>


Généré le : Sat Nov 24 09:27:55 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics