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

   1  <?php
   2  include  ("../jpgraph.php");
   3  include  ("../jpgraph_log.php");
   4  include  ("../jpgraph_line.php");
   5  
   6  $ydata = array(11,3,8,12,5,1,9,13,5,7);
   7  $y2data = array(354,200,265,99,111,91,198,225,293,251);
   8  
   9  // Create the graph. These two calls are always required
  10  $graph = new Graph(350,200,"auto");    
  11  $graph->img->SetMargin(40,110,20,40);
  12  $graph->SetScale("textlog");
  13  $graph->SetY2Scale("log");
  14  $graph->SetShadow();
  15  
  16  $graph->ygrid->Show(true,true);
  17  $graph->xgrid->Show(true,false);
  18  
  19  // Create the linear plot
  20  $lineplot=new LinePlot($ydata);
  21  $lineplot2=new LinePlot($y2data);
  22  
  23  $graph->yaxis->scale->ticks->SupressFirst();
  24  $graph->y2axis->scale->ticks->SupressFirst();
  25  // Add the plot to the graph
  26  $graph->Add($lineplot);
  27  $graph->AddY2($lineplot2);
  28  $lineplot2->SetColor("orange");
  29  $lineplot2->SetWeight(2);
  30  $graph->y2axis->SetColor("orange");
  31  
  32  $graph->title->Set("Example 8");
  33  $graph->xaxis->title->Set("X-title");
  34  $graph->yaxis->title->Set("Y-title");
  35  
  36  $graph->title->SetFont(FF_FONT1,FS_BOLD);
  37  $graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
  38  $graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
  39  
  40  $lineplot->SetColor("blue");
  41  $lineplot->SetWeight(2);
  42  
  43  $lineplot2->SetColor("orange");
  44  $lineplot2->SetWeight(2);
  45  
  46  $graph->yaxis->SetColor("blue");
  47  
  48  $lineplot->SetLegend("Plot 1");
  49  $lineplot2->SetLegend("Plot 2");
  50  
  51  $graph->legend->Pos(0.05,0.5,"right","center");
  52  
  53  // Display the graph
  54  $graph->Stroke();
  55  ?>


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