[ Index ]
 

Code source de jpGraph 2.2

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

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

   1  <?php
   2  include  ("../jpgraph.php");
   3  include  ("../jpgraph_line.php");
   4  
   5  $ydata = array(11,3,8,12,5,1,9,13,5,7);
   6  $y2data = array(354,200,265,99,111,91,198,225,293,251);
   7  
   8  // Create the graph. These two calls are always required
   9  $graph = new Graph(300,200,"auto");    
  10  $graph->img->SetMargin(40,40,20,40);
  11  $graph->SetScale("textlin");
  12  $graph->SetY2Scale("lin");
  13  $graph->SetShadow();
  14  
  15  // Create the linear plot
  16  $lineplot=new LinePlot($ydata);
  17  $lineplot2=new LinePlot($y2data);
  18  
  19  // Add the plot to the graph
  20  $graph->Add($lineplot);
  21  $graph->AddY2($lineplot2);
  22  $lineplot2->SetColor("orange");
  23  $lineplot2->SetWeight(2);
  24  $graph->y2axis->SetColor("orange");
  25  
  26  $graph->title->Set("Example 5");
  27  $graph->xaxis->title->Set("X-title");
  28  $graph->yaxis->title->Set("Y-title");
  29  
  30  $graph->title->SetFont(FF_FONT1,FS_BOLD);
  31  $graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
  32  $graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
  33  
  34  $lineplot->SetColor("blue");
  35  $lineplot->SetWeight(2);
  36  
  37  $lineplot2->SetColor("orange");
  38  $lineplot2->SetWeight(2);
  39  
  40  $graph->yaxis->SetColor("blue");
  41  
  42  // Display the graph
  43  $graph->Stroke();
  44  ?>


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