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

   1  <?php
   2  include  ("../jpgraph.php");
   3  include  ("../jpgraph_line.php");
   4  
   5  // Some data
   6  $datay = array(28,19,18,23,12,11);
   7  $data2y = array(14,18,33,29,39,55);
   8  
   9  // A nice graph with anti-aliasing
  10  $graph = new Graph(400,200,"auto");
  11  $graph->img->SetMargin(40,180,40,40);    
  12  $graph->SetBackgroundImage("tiger_bkg.png",1);
  13  
  14  // Adjust brightness and contrast for background image
  15  // must be between -1 <= x <= 1, (0,0)=original image
  16  $graph->AdjBackgroundImage(0,0);
  17  
  18  $graph->img->SetAntiAliasing("white");
  19  $graph->SetScale("textlin");
  20  $graph->SetShadow();
  21  $graph->title->Set("Background image");
  22  
  23  // Use built in font
  24  $graph->title->SetFont(FF_FONT1,FS_BOLD);
  25  
  26  // Slightly adjust the legend from it's default position in the
  27  // top right corner. 
  28  $graph->legend->Pos(0.05,0.5,"right","center");
  29  
  30  // Create the first line
  31  $p1 = new LinePlot($datay);
  32  $p1->mark->SetType(MARK_FILLEDCIRCLE);
  33  $p1->mark->SetFillColor("red");
  34  $p1->mark->SetWidth(4);
  35  $p1->SetColor("blue");
  36  $p1->SetCenter();
  37  $p1->SetLegend("Triumph Tiger -98");
  38  $graph->Add($p1);
  39  
  40  // ... and the second
  41  $p2 = new LinePlot($data2y);
  42  $p2->mark->SetType(MARK_STAR);
  43  $p2->mark->SetFillColor("red");
  44  $p2->mark->SetWidth(4);
  45  $p2->SetColor("red");
  46  $p2->SetCenter();
  47  $p2->SetLegend("New tiger -99");
  48  $graph->Add($p2);
  49  
  50  // Output line
  51  $graph->Stroke();
  52  
  53  ?>
  54  
  55  


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