Blame view

site/jpgraph/Examples/filledstepstyleex1.php 1.01 KB
8ec98c9f   Guillaume   MAJ
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
  <?php // content="text/plain; charset=utf-8"
  
  require_once ('jpgraph/jpgraph.php');
  require_once ('jpgraph/jpgraph_line.php');
  
  // create the graph
  $graph= new Graph(400,250);
  $graph->clearTheme();
  
  $ydata = array(5,10,15,20,15,10);
  
  $graph->SetScale("textlin");
  $graph->SetShadow(true);
  $graph->SetMarginColor("antiquewhite");
  $graph->img->SetMargin(60,40,40,50);
  $graph->img->setTransparent("white");
  $graph->xaxis->SetFont(FF_FONT1);
  $graph->xaxis->setTextTickInterval(1);
  $graph->xaxis->SetTextLabelInterval(1);
  $graph->legend->SetFillColor("antiquewhite");
  $graph->legend->SetShadow(true);
  $graph->legend->SetLayout(LEGEND_VERT);
  $graph->legend->Pos(0.02,0.01);
  $graph->title->Set("Step Styled Example");
  $graph->title->SetFont(FF_FONT1,FS_BOLD);
  
  $lineplot = new LinePlot($ydata);
  $lineplot->SetColor("black");
  $lineplot->setFillColor("gray7");
  $lineplot->SetStepStyle();
  $lineplot->SetLegend(" 2002 ");
  
  // add plot to the graph
  $graph->Add($lineplot);
  $graph->ygrid->show(false,false);
  
  // display graph
  $graph->Stroke();
  
  ?>