Commit ab15bd7479d8320339db8739e9d5ac422069b0c1

Authored by Guillaume
1 parent f4782e65

Test Graphe

Showing 3 changed files with 15 additions and 2 deletions   Show diff stats
site/accesBase.php
... ... @@ -274,4 +274,13 @@
274 274 }
275 275 }
276 276 }
  277 +
  278 + function makeArray($tab, $column)
  279 + {
  280 + foreach($tab as $element)
  281 + {
  282 + $array[] = $element[$column];
  283 + }
  284 + return $array;
  285 + }
277 286 ?>
... ...
site/graphe.php
1 1 <?php // content="text/plain; charset=utf-8"
2 2 require_once ('jpgraph/jpgraph.php');
3 3 require_once ('jpgraph/jpgraph_line.php');
  4 +require_once('accesBase.php');
4 5  
5   -$datay1 = array(20,15,23,15);
  6 +$history = getHistory('TempĂȘte', '', '', '2020-01-02 00:00:00', '2020-04-05 23:59:59', 4);
  7 +$datay1 = makeArray($history, "value");
  8 +
  9 +//$datay1 = array(20,15,23,15);
6 10 $datay2 = array(12,9,42,8);
7 11 $datay3 = array(5,17,32,24);
8 12  
... ...
site/graphique.php
... ... @@ -18,7 +18,7 @@ session_start();
18 18 <div class="row">
19 19 <div class="col-8 col-md-8 offset-md-2 offset-2">
20 20 <br/>
21   - <h1 style="margin-bottom:20px; margin-top:30px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fa fa-bars"></i> Graphe du capteur</h1>
  21 + <h1 style="margin-bottom:20px; margin-top:30px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fas fa-chart-line"></i> Graphe du capteur</h1>
22 22 <br/>
23 23 <img src="graphe.php" alt="graphe">
24 24 </div>
... ...