Commit 8445b765f9255efee141ee7c3b50ee6aec996784
1 parent
b7ad4458
Test Graphe
Showing
1 changed file
with
4 additions
and
15 deletions
Show diff stats
site/graphe.php
... | ... | @@ -4,18 +4,7 @@ require_once ('jpgraph/jpgraph_line.php'); |
4 | 4 | require_once('accesBase.php'); |
5 | 5 | |
6 | 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 | 9 | // Setup the graph |
21 | 10 | $graph = new Graph(800,400); |
... | ... | @@ -25,7 +14,7 @@ $theme_class=new UniversalTheme; |
25 | 14 | |
26 | 15 | $graph->SetTheme($theme_class); |
27 | 16 | $graph->img->SetAntiAliasing(false); |
28 | -$graph->title->Set('Graphique'); | |
17 | +$graph->title->Set('Filled Y-grid'); | |
29 | 18 | $graph->SetBox(false); |
30 | 19 | |
31 | 20 | $graph->SetMargin(40,20,36,63); |
... | ... | @@ -38,14 +27,14 @@ $graph->yaxis->HideTicks(false,false); |
38 | 27 | |
39 | 28 | $graph->xgrid->Show(); |
40 | 29 | $graph->xgrid->SetLineStyle("solid"); |
41 | -$graph->xaxis->SetTickLabels(Array('A', 'B', 'C', 'D')); | |
30 | +$graph->xaxis->SetTickLabels(array('A','B','C','D')); | |
42 | 31 | $graph->xgrid->SetColor('#E3E3E3'); |
43 | 32 | |
44 | 33 | // Create the first line |
45 | 34 | $p = new LinePlot($datay); |
46 | 35 | $graph->Add($p); |
47 | 36 | $p->SetColor("#6495ED"); |
48 | -$p->SetLegend('Line 1'); | |
37 | +$p->SetLegend('Capteur'); | |
49 | 38 | |
50 | 39 | $graph->legend->SetFrameWeight(1); |
51 | 40 | |
... | ... |