Commit 407dc30262fac2979a7cfa917ee8b01f0e51161b
1 parent
ec0bc929
Graphes ok
Showing
4 changed files
with
23 additions
and
12 deletions
Show diff stats
site/formGraphe.php
... | ... | @@ -42,7 +42,7 @@ $date_max = $maxs[0]; |
42 | 42 | |
43 | 43 | <tr> |
44 | 44 | <td><label for"nombre">Nombre de points (entre 4 et 100) :</label></td> |
45 | - <td><input type="text" id="nombre" name="nombre" min="4" max="100" value="10" /></td> | |
45 | + <td><input type="text" id="nombre" name="nombre" min="4" max="100" value="4" /></td> | |
46 | 46 | </tr> |
47 | 47 | </tbody> |
48 | 48 | </table> | ... | ... |
site/graphe.php
... | ... | @@ -18,10 +18,10 @@ $theme_class=new UniversalTheme; |
18 | 18 | |
19 | 19 | $graph->SetTheme($theme_class); |
20 | 20 | $graph->img->SetAntiAliasing(false); |
21 | -$graph->title->Set('Filled Y-grid'); | |
21 | +$graph->title->Set('Capteur '.$_REQUEST['nom']); | |
22 | 22 | $graph->SetBox(false); |
23 | 23 | |
24 | -$graph->SetMargin(20,20,20,20); | |
24 | +$graph->SetMargin(40,30,40,50); | |
25 | 25 | |
26 | 26 | $graph->img->SetAntiAliasing(); |
27 | 27 | |
... | ... | @@ -34,13 +34,26 @@ $graph->xgrid->SetLineStyle("solid"); |
34 | 34 | $graph->xaxis->SetTickLabels($datax); |
35 | 35 | $graph->xgrid->SetColor('#E3E3E3'); |
36 | 36 | |
37 | -// Create the first line | |
37 | +// Create the line | |
38 | 38 | $p = new LinePlot($datay); |
39 | 39 | $graph->Add($p); |
40 | 40 | $p->SetColor("#6495ED"); |
41 | -$p->SetLegend('Capteur'); | |
42 | 41 | |
43 | -$graph->legend->SetFrameWeight(1); | |
42 | +// Afficher les valeurs pour chaque point | |
43 | +$p->value->Show(); | |
44 | + | |
45 | +// Valeurs: Apparence de la police | |
46 | +$p->value->SetFormat('%.1f'); | |
47 | +$p->value->SetColor("red"); | |
48 | + | |
49 | +// Chaque point de la courbe **** | |
50 | +// Type de point | |
51 | +$p->mark->SetType(MARK_FILLEDCIRCLE); | |
52 | +// Couleur de remplissage | |
53 | +$p->mark->SetFillColor("green"); | |
54 | +// Taille | |
55 | +$p->mark->SetWidth(5); | |
56 | + | |
44 | 57 | |
45 | 58 | // Output line |
46 | 59 | $graph->Stroke(); | ... | ... |
site/graphique.php
... | ... | @@ -28,8 +28,6 @@ else $start = $start." 00:00:00"; |
28 | 28 | <div class="col-8 col-md-8 offset-md-2 offset-2"> |
29 | 29 | <br/> |
30 | 30 | <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> |
31 | - <br/> | |
32 | - | |
33 | 31 | <?php |
34 | 32 | echo "<img src='graphe.php?nom=$nom&nombre=$nombre&start=$start&end=$end' alt='graphe'>"; |
35 | 33 | ?> | ... | ... |
site/header.php
... | ... | @@ -9,12 +9,12 @@ |
9 | 9 | require_once("accesBase.php") ; |
10 | 10 | $membre = getMembreByIdPwd($_SESSION['Login'], $_SESSION['Password']); |
11 | 11 | ?> |
12 | - <!-- <a href="settings.php"><i class="fa fa-cog"></i> <?php echo $membre['prenom']; echo ' '; echo $membre['nom'];?></a> --> | |
13 | - <a href="ajoutRaspberry.php"><i class="far fa-plus-square"></i> Ajouter une Raspberry</a> | |
14 | - <a href="ajoutCapteur.php"><i class="far fa-plus-square"></i> Ajouter un capteur</a> | |
12 | + <a href="ajoutRaspberry.php"><i class="far fa-plus-square"></i> Raspberry</a> | |
13 | + <a href="ajoutCapteur.php"><i class="far fa-plus-square"></i> Capteur</a> | |
15 | 14 | <a href="send.php"><i class="fa fa-file-upload"></i> Envoyer un code</a> |
16 | 15 | <a href="history.php"><i class="fas fa-history"></i> Historique</a> |
17 | - <a href="data.php"><i class="fas fa-database"></i> Valeurs des capteurs</a> | |
16 | + <a href="history.php"><i class="fas fa-chart-line"></i> Graphiques</a> | |
17 | + <a href="data.php"><i class="fas fa-database"></i> Valeurs</a> | |
18 | 18 | <a href="deconnecter.php"><i class="fa fa-power-off"></i> Deconnexion</a> |
19 | 19 | <?php |
20 | 20 | } | ... | ... |