Blame view

site/jpgraph/Examples/bartutex1.php 741 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');
  
  // Some data
  $databary=array(12,7,16,5,7,14,9,3);
  
  // New graph with a drop shadow
  $graph = new Graph(300,200);
  $graph->clearTheme();
  $graph->SetShadow();
  
  // Use a "text" X-scale
  $graph->SetScale("textlin");
  
  // Set title and subtitle
  $graph->title->Set("Elementary barplot with a text scale");
  
  // Use built in font
  $graph->title->SetFont(FF_FONT1,FS_BOLD);
  
  // Create the bar plot
  $b1 = new BarPlot($databary);
  $b1->SetLegend("Temperature");
  //$b1->SetAbsWidth(6);
  //$b1->SetShadow();
  
  // The order the plots are added determines who's ontop
  $graph->Add($b1);
  
  // Finally output the  image
  $graph->Stroke();
  
  ?>