[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 <?php 2 include ("../jpgraph.php"); 3 include ("../jpgraph_line.php"); 4 5 // Some data 6 $datax = array("2001-04-01","2001-04-02","2001-04-03", 7 "2001-04-04","2001-04-05","2001-04-06"); 8 $datay = array(28,13,24,"",90,11); 9 $data2y = array(11,41,"-",33,"-",63); 10 11 // A nice graph with anti-aliasing 12 $graph = new Graph(450,250,"auto"); 13 $graph->img->SetMargin(40,170,40,80); 14 //$graph->img->SetAntiAliasing(); 15 $graph->SetScale("textlin"); 16 $graph->SetShadow(); 17 $graph->title->Set("Line plot with null values"); 18 19 // Use built in font 20 $graph->title->SetFont(FF_FONT1,FS_BOLD); 21 22 // Slightly adjust the legend from it's default position in the 23 // top right corner. 24 $graph->legend->Pos(0.03,0.5,"right","center"); 25 26 // Setup X-scale 27 $graph->xaxis->SetTickLabels($datax); 28 $graph->xaxis->SetFont(FF_FONT1); 29 $graph->xaxis->SetLabelAngle(90); 30 31 // Create the first line 32 $p1 = new LinePlot($datay); 33 $p1->mark->SetType(MARK_FILLEDCIRCLE); 34 $p1->mark->SetFillColor("red"); 35 $p1->mark->SetWidth(4); 36 $p1->SetColor("blue"); 37 $p1->SetCenter(); 38 $p1->SetLegend("Undefined variant 1"); 39 $graph->Add($p1); 40 41 // ... and the second 42 $p2 = new LinePlot($data2y); 43 $p2->mark->SetType(MARK_STAR); 44 $p2->mark->SetFillColor("red"); 45 $p2->mark->SetWidth(4); 46 $p2->SetColor("red"); 47 $p2->SetCenter(); 48 $p2->SetLegend("Undefined variant 2"); 49 $graph->Add($p2); 50 51 // Output line 52 $graph->Stroke(); 53 54 ?> 55 56
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |