Blame view

site/graphe.php 1.04 KB
a4e386fb   root   Ajout graphe V1
1
  <?php // content="text/plain; charset=utf-8"
e65076e1   root   MAJ
2
3
  require_once ('jpgraph/jpgraph.php');
  require_once ('jpgraph/jpgraph_line.php');
ab15bd74   Guillaume   Test Graphe
4
  require_once('accesBase.php');
a4e386fb   root   Ajout graphe V1
5
  
e7a12237   Guillaume   Test Graphe
6
  $history = getHistory($_REQUEST['nom'], '', '', $_REQUEST['start'], $_REQUEST['end'], $_REQUEST['nombre']);
8445b765   Guillaume   Test Graphe
7
  $datay = makeArray($history, "value");
a4e386fb   root   Ajout graphe V1
8
9
  
  // Setup the graph
360100a5   Guillaume   MAJ
10
  $graph = new Graph(800,400);
a4e386fb   root   Ajout graphe V1
11
12
13
14
15
16
  $graph->SetScale("textlin");
  
  $theme_class=new UniversalTheme;
  
  $graph->SetTheme($theme_class);
  $graph->img->SetAntiAliasing(false);
8445b765   Guillaume   Test Graphe
17
  $graph->title->Set('Filled Y-grid');
a4e386fb   root   Ajout graphe V1
18
19
20
21
22
23
24
25
26
27
28
29
  $graph->SetBox(false);
  
  $graph->SetMargin(40,20,36,63);
  
  $graph->img->SetAntiAliasing();
  
  $graph->yaxis->HideZeroLabel();
  $graph->yaxis->HideLine(false);
  $graph->yaxis->HideTicks(false,false);
  
  $graph->xgrid->Show();
  $graph->xgrid->SetLineStyle("solid");
8445b765   Guillaume   Test Graphe
30
  $graph->xaxis->SetTickLabels(array('A','B','C','D'));
a4e386fb   root   Ajout graphe V1
31
32
33
  $graph->xgrid->SetColor('#E3E3E3');
  
  // Create the first line
e7a12237   Guillaume   Test Graphe
34
35
36
  $p = new LinePlot($datay);
  $graph->Add($p);
  $p->SetColor("#6495ED");
8445b765   Guillaume   Test Graphe
37
  $p->SetLegend('Capteur');
a4e386fb   root   Ajout graphe V1
38
39
40
41
42
43
44
  
  $graph->legend->SetFrameWeight(1);
  
  // Output line
  $graph->Stroke();
  
  ?>