From 0071f5d7df2686c1663c5c893515f2d69071e034 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 21 Mar 2020 10:19:55 +0000 Subject: [PATCH] MAJ --- site/accesBase.php | 12 +++++++++++- site/formGraphe.php | 6 +++--- site/graphe.php | 13 ++++++++----- site/graphique.php | 4 ++-- 4 files changed, 24 insertions(+), 11 deletions(-) diff --git a/site/accesBase.php b/site/accesBase.php index e45f7f7..73c7be2 100644 --- a/site/accesBase.php +++ b/site/accesBase.php @@ -282,5 +282,15 @@ $array[] = $element[$column]; } return $array; - } + } + + function getLegend($nom) + { + $db = connexion(); + $query = "SELECT type, unite FROM capteurs WHERE nom = '$nom'"; + $result = pg_query($db, $query) or die("La requ te a echou : ".pg_last_error()); + $tab = pg_fetch_assoc($result); + deconnexion($db); + return $tab; + } ?> diff --git a/site/formGraphe.php b/site/formGraphe.php index af6096a..9dc3048 100644 --- a/site/formGraphe.php +++ b/site/formGraphe.php @@ -10,7 +10,7 @@ $date_max = $maxs[0];

-

Affichage un graphe

+

Affichage d'un graphe

@@ -41,8 +41,8 @@ $date_max = $maxs[0]; - - + +
diff --git a/site/graphe.php b/site/graphe.php index e08a96c..a675039 100644 --- a/site/graphe.php +++ b/site/graphe.php @@ -3,6 +3,7 @@ require_once ('jpgraph/jpgraph.php'); require_once ('jpgraph/jpgraph_line.php'); require_once('accesBase.php'); +$legend = getLegend($_REQUEST['nom']); $history = getHistory($_REQUEST['nom'], '', '', $_REQUEST['start'], $_REQUEST['end'], $_REQUEST['nombre']); $y = makeArray($history, "value"); $x = makeArray($history, "date"); @@ -11,7 +12,7 @@ $datay = array_reverse($y); $datax = array_reverse($x); // Setup the graph -$graph = new Graph(800,400); +$graph = new Graph(1100,400); $graph->SetScale("textlin"); $theme_class=new UniversalTheme; @@ -21,36 +22,38 @@ $graph->img->SetAntiAliasing(false); $graph->title->Set('Capteur '.$_REQUEST['nom']); $graph->SetBox(false); -$graph->SetMargin(40,30,40,50); +$graph->SetMargin(40,30,40,150); $graph->img->SetAntiAliasing(); $graph->yaxis->HideZeroLabel(); $graph->yaxis->HideLine(false); $graph->yaxis->HideTicks(false,false); +$graph->yaxis->title->Set($legend['type']."(".$legend['unite'].")"); $graph->xgrid->Show(); $graph->xgrid->SetLineStyle("solid"); $graph->xaxis->SetTickLabels($datax); +$graph->xaxis->SetLabelAngle(80); $graph->xgrid->SetColor('#E3E3E3'); // Create the line $p = new LinePlot($datay); $graph->Add($p); -$p->SetColor("#6495ED"); +$p->SetColor('#5c0f10'); // Afficher les valeurs pour chaque point $p->value->Show(); // Valeurs: Apparence de la police $p->value->SetFormat('%.1f'); -$p->value->SetColor("red"); +$p->value->SetColor('#0c0f52'); // Chaque point de la courbe **** // Type de point $p->mark->SetType(MARK_FILLEDCIRCLE); // Couleur de remplissage -$p->mark->SetFillColor("green"); +$p->mark->SetFillColor('#0D0D0D'); // Taille $p->mark->SetWidth(5); diff --git a/site/graphique.php b/site/graphique.php index 22cad5d..7e56828 100644 --- a/site/graphique.php +++ b/site/graphique.php @@ -25,9 +25,9 @@ else $start = $start." 00:00:00"; { ?>
-
+

-

Graphe du capteur

+

Graphe du capteur

"; ?> -- libgit2 0.21.2