[ Index ]
 

Code source de jpGraph 2.2

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

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

   1  <?php
   2  include  ("../jpgraph.php");
   3  include  ("../jpgraph_pie.php");
   4  
   5  $data = array(19,12,4,3,3,12,3,3,5,6,7,8,8,1,7,2,2,4,6,8,21,23,2,2,12);
   6  
   7  // Create the Pie Graph.
   8  $graph = new PieGraph(300,350);
   9  
  10  // Set A title for the plot
  11  $graph->title->Set("Label guide lines");
  12  $graph->title->SetFont(FF_VERDANA,FS_BOLD,12); 
  13  $graph->title->SetColor("darkblue");
  14  $graph->legend->Pos(0.1,0.2);
  15  
  16  
  17  // Create pie plot
  18  $p1 = new PiePlot($data);
  19  $p1->SetCenter(0.5,0.55);
  20  $p1->SetSize(0.3);
  21  
  22  // Enable and set policy for guide-lines
  23  $p1->SetGuideLines();
  24  $p1->SetGuideLinesAdjust(1.4);
  25  
  26  // Setup the labels
  27  $p1->SetLabelType(PIE_VALUE_PER);    
  28  $p1->value->Show();            
  29  $p1->value->SetFont(FF_ARIAL,FS_NORMAL,9);    
  30  $p1->value->SetFormat('%2.1f%%');        
  31  
  32  // Add and stroke
  33  $graph->Add($p1);
  34  $graph->Stroke();
  35  
  36  ?>
  37  
  38  


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