Blame view

site/jpgraph/Examples/barpatternex1.php 809 Bytes
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
  <?php // content="text/plain; charset=utf-8"
  
  require_once ('jpgraph/jpgraph.php');
  require_once ('jpgraph/jpgraph_bar.php');
  require_once ('jpgraph/jpgraph_line.php');
  
  $datay=array(2,3,5,8.5,11.5,6,3);
  
  // Create the graph.
  $graph = new Graph(350,300);
  $graph->clearTheme();
  
  $graph->SetScale("textlin");
  
  $graph->SetMarginColor('navy:1.9');
  $graph->SetBox();
  
  $graph->title->Set('Bar Pattern');
  $graph->title->SetFont(FF_ARIAL,FS_BOLD,20);
  
  $graph->SetTitleBackground('lightblue:1.3',TITLEBKG_STYLE2,TITLEBKG_FRAME_BEVEL);
  $graph->SetTitleBackgroundFillStyle(TITLEBKG_FILLSTYLE_HSTRIPED,'lightblue','blue');
  
  // Create a bar pot
  $bplot = new BarPlot($datay);
  $bplot->SetFillColor('darkorange');
  $bplot->SetWidth(0.6);
  
  $bplot->SetPattern(PATTERN_CROSS1,'navy');
  
  $graph->Add($bplot);
  
  $graph->Stroke();
  ?>