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

   1  <?php
   2  include  ("../jpgraph.php");
   3  include  ("../jpgraph_bar.php");
   4  
   5  $data1y=array(12,8,19,3,10,5);
   6  $data2y=array(8,2,12,7,14,4);
   7  
   8  // Create the graph. These two calls are always required
   9  $graph = new Graph(310,200);
  10  $graph->SetScale("textlin");
  11  $graph->img->SetMargin(40,30,20,40);
  12  $graph->SetShadow();
  13  
  14  // Create the bar plots
  15  $b1plot = new BarPlot($data1y);
  16  $b1plot->SetFillColor("orange");
  17  $targ=array("bar_clsmex2.php#1","bar_clsmex2.php#2","bar_clsmex2.php#3",
  18  "bar_clsmex2.php#4","bar_clsmex2.php#5","bar_clsmex2.php#6");
  19  $alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");
  20  $b1plot->SetCSIMTargets($targ,$alts);
  21  
  22  $b2plot = new BarPlot($data2y);
  23  $b2plot->SetFillColor("blue");
  24  $targ=array("bar_clsmex2.php#7","bar_clsmex2.php#8","bar_clsmex2.php#9",
  25  "bar_clsmex2.php#10","bar_clsmex2.php#11","bar_clsmex2.php#12");
  26  $alts=array("val=%v","val=%v","val=%v","val=%v","val=%v","val=%v");
  27  $b2plot->SetCSIMTargets($targ,$alts);
  28  
  29  // Create the grouped bar plot
  30  $abplot = new AccBarPlot(array($b1plot,$b2plot));
  31  
  32  $abplot->SetShadow();
  33  $abplot->ShowValue();
  34  
  35  // ...and add it to the graPH
  36  $graph->Add($abplot);
  37  
  38  $graph->title->Set("Image map barex2");
  39  $graph->xaxis->title->Set("X-title");
  40  $graph->yaxis->title->Set("Y-title");
  41  
  42  $graph->title->SetFont(FF_FONT1,FS_BOLD);
  43  $graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
  44  $graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
  45  
  46  // Display the graph
  47  $graph->Stroke(GenImgName());
  48  
  49  
  50  echo $graph->GetHTMLImageMap("myimagemap");
  51  echo "<img src=\"".GenImgName()."\" ISMAP USEMAP=\"#myimagemap\" border=0>";
  52  ?>


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