Commit 8445b765f9255efee141ee7c3b50ee6aec996784

Authored by Guillaume
1 parent b7ad4458

Test Graphe

Showing 1 changed file with 4 additions and 15 deletions   Show diff stats
@@ -4,18 +4,7 @@ require_once ('jpgraph/jpgraph_line.php'); @@ -4,18 +4,7 @@ require_once ('jpgraph/jpgraph_line.php');
4 require_once('accesBase.php'); 4 require_once('accesBase.php');
5 5
6 $history = getHistory($_REQUEST['nom'], '', '', $_REQUEST['start'], $_REQUEST['end'], $_REQUEST['nombre']); 6 $history = getHistory($_REQUEST['nom'], '', '', $_REQUEST['start'], $_REQUEST['end'], $_REQUEST['nombre']);
7 -$datay1 = makeArray($history, "value");  
8 -$absc = makeArray($history, "value");  
9 -  
10 -//$history2 = getHistory('Atmos', '', '', '2020-01-02 00:00:00', '2020-04-05 23:59:59', 4);  
11 -//$datay2 = makeArray($history2, "value");  
12 -  
13 -//$history3 = getHistory('Fusion', '', '', '2020-01-02 00:00:00', '2020-04-05 23:59:59', 4);  
14 -//$datay3 = makeArray($history3, "value");  
15 -  
16 -//$datay1 = array(20,15,23,15);  
17 -//$datay2 = array(12,9,42,8);  
18 -//$datay3 = array(5,17,32,24); 7 +$datay = makeArray($history, "value");
19 8
20 // Setup the graph 9 // Setup the graph
21 $graph = new Graph(800,400); 10 $graph = new Graph(800,400);
@@ -25,7 +14,7 @@ $theme_class=new UniversalTheme; @@ -25,7 +14,7 @@ $theme_class=new UniversalTheme;
25 14
26 $graph->SetTheme($theme_class); 15 $graph->SetTheme($theme_class);
27 $graph->img->SetAntiAliasing(false); 16 $graph->img->SetAntiAliasing(false);
28 -$graph->title->Set('Graphique'); 17 +$graph->title->Set('Filled Y-grid');
29 $graph->SetBox(false); 18 $graph->SetBox(false);
30 19
31 $graph->SetMargin(40,20,36,63); 20 $graph->SetMargin(40,20,36,63);
@@ -38,14 +27,14 @@ $graph->yaxis->HideTicks(false,false); @@ -38,14 +27,14 @@ $graph->yaxis->HideTicks(false,false);
38 27
39 $graph->xgrid->Show(); 28 $graph->xgrid->Show();
40 $graph->xgrid->SetLineStyle("solid"); 29 $graph->xgrid->SetLineStyle("solid");
41 -$graph->xaxis->SetTickLabels(Array('A', 'B', 'C', 'D')); 30 +$graph->xaxis->SetTickLabels(array('A','B','C','D'));
42 $graph->xgrid->SetColor('#E3E3E3'); 31 $graph->xgrid->SetColor('#E3E3E3');
43 32
44 // Create the first line 33 // Create the first line
45 $p = new LinePlot($datay); 34 $p = new LinePlot($datay);
46 $graph->Add($p); 35 $graph->Add($p);
47 $p->SetColor("#6495ED"); 36 $p->SetColor("#6495ED");
48 -$p->SetLegend('Line 1'); 37 +$p->SetLegend('Capteur');
49 38
50 $graph->legend->SetFrameWeight(1); 39 $graph->legend->SetFrameWeight(1);
51 40