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);