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

   1  <?php
   2  include  ("../jpgraph.php");
   3  include  ("../jpgraph_line.php");
   4  include  ("../jpgraph_bar.php");
   5  
   6  // Some data
   7  
   8  $steps=100;
   9  for($i=0; $i<$steps; ++$i) {
  10      $datay[$i]=log(pow($i,$i/10)+1)*sin($i/15)+35;
  11      $datax[]=$i;
  12      if( $i % 10 == 0 ) {
  13          $databarx[]=$i;
  14          $databary[]=$datay[$i]/2;
  15      }
  16  }
  17  
  18  // New graph with a background image and drop shadow
  19  $graph = new Graph(450,300,"auto");
  20  $graph->img->SetMargin(40,180,40,40);    
  21  $graph->SetBackgroundImage("tiger_bkg.png",3);
  22  
  23  //$graph->img->SetAntiAliasing();
  24  $graph->SetScale("intlin");
  25  $graph->SetShadow();
  26  $graph->title->Set("Combined bar and line plot");
  27  $graph->subtitle->Set("(\"center\" aligned bars)");
  28  
  29  // Use built in font
  30  $graph->title->SetFont(FF_FONT1,FS_BOLD);
  31  
  32  // Slightly adjust the legend from it's default position in the
  33  // top right corner. 
  34  $graph->legend->Pos(0.05,0.5,"right","center");
  35  
  36  
  37  // Create the first line
  38  $p1 = new LinePlot($datay,$datax);
  39  $p1->SetWeight(1);
  40  $p1->SetColor("red");
  41  $p1->SetLegend("Triumph Tiger -98");
  42  $graph->Add($p1);
  43  
  44  $b1 = new BarPlot($databary,$databarx);
  45  $b1->SetAbsWidth(10);
  46  $b1->SetAlign("center");
  47  $b1->SetShadow();
  48  $graph->Add($b1);
  49  
  50  $graph->Stroke();
  51  
  52  ?>
  53  
  54  


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