From 79ae8d24e23fe7218d2af0823367112ab8630203 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sun, 14 Aug 2005 14:30:47 +0000 Subject: [PATCH] =?UTF-8?q?Modification=20de=20l'=E9chelle=20des=20graphs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/energie/graph-line.php | 4 ++-- scripts/energie/graph.php | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/energie/graph-line.php b/scripts/energie/graph-line.php index e2c77c07ead..0cbd870f1ce 100644 --- a/scripts/energie/graph-line.php +++ b/scripts/energie/graph-line.php @@ -154,7 +154,7 @@ if ($resql_c) $width = 750; $height = 300; $graph = new Graph($width, $height,"auto"); - $graph->SetScale("textlin",0,$maxa); + $graph->SetScale("textlin"); $graph->yaxis->scale->SetGrace(2); $graph->SetFrame(1); @@ -178,7 +178,7 @@ if ($resql_c) $width = 300; $height = 90; $graph = new Graph($width, $height,"auto"); - $graph->SetScale("textlin",0,$maxa); + $graph->SetScale("textlin"); $graph->yaxis->scale->SetGrace(2); $graph->SetFrame(1); diff --git a/scripts/energie/graph.php b/scripts/energie/graph.php index 25550f538b3..348ba78ab8c 100644 --- a/scripts/energie/graph.php +++ b/scripts/energie/graph.php @@ -34,13 +34,6 @@ include_once (JPGRAPH_DIR."jpgraph_canvas.php"); $error = 0; -$labels = array(); -$datas = array(); - -$ydatas = array(); -$mdatas = array(); -$wdatas = array(); - $sql_c = "SELECT rowid"; $sql_c .= " FROM ".MAIN_DB_PREFIX."energie_compteur"; @@ -59,6 +52,14 @@ if ($resql_c) $compteur_id = $obj_c->rowid; + $labels = array(); + $datas = array(); + + $ydatas = array(); + $mdatas = array(); + $wdatas = array(); + + $sql = "SELECT ".$db->pdate("date_releve")." as date_releve, valeur"; $sql .= " FROM ".MAIN_DB_PREFIX."energie_compteur_releve"; $sql .= " WHERE fk_compteur = ".$obj_c->rowid; @@ -119,7 +120,6 @@ if ($resql_c) // Graph $maxa = 0; - for ($i = 1 ; $i < sizeof($datas) ; $i++) { @@ -148,8 +148,8 @@ if ($resql_c) if (sizeof($gdatas) > 2) { $graph = new Graph($width, $height,"auto"); - $graph->SetScale("textlin",0,$maxa); - + + $graph->SetScale("textlin"); $graph->yaxis->scale->SetGrace(2); $graph->SetFrame(1); $graph->img->SetMargin(40,20,20,35);