[ Index ]
 

Code source de jpGraph 2.2

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

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

   1  <?php
   2  include  ("../jpgraph.php");
   3  include  ("../jpgraph_bar.php");
   4  
   5  // Some data
   6  $months=$gDateLocale->GetShortMonth();
   7  
   8  srand ((double) microtime() * 1000000);
   9  for( $i=0; $i<25; ++$i) {
  10      $databary[]=rand(1,50);
  11      $databarx[]=$months[$i%12];
  12  }
  13      
  14  // New graph with a drop shadow
  15  $graph = new Graph(300,200,'auto');
  16  $graph->SetShadow();
  17  
  18  // Use a "text" X-scale
  19  $graph->SetScale("textlin");
  20  
  21  // Specify X-labels
  22  $graph->xaxis->SetTickLabels($databarx);
  23  
  24  // Set title and subtitle
  25  $graph->title->Set("Bar tutorial example 3");
  26  
  27  // Use built in font
  28  $graph->title->SetFont(FF_FONT1,FS_BOLD);
  29  
  30  // Create the bar plot
  31  $b1 = new BarPlot($databary);
  32  $b1->SetLegend("Temperature");
  33  //$b1->SetAbsWidth(6);
  34  //$b1->SetShadow();
  35  
  36  // The order the plots are added determines who's ontop
  37  $graph->Add($b1);
  38  
  39  // Finally output the  image
  40  $graph->Stroke();
  41  
  42  ?>
  43  
  44  


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