Modification de l'chelle des graphs

This commit is contained in:
Rodolphe Quiedeville 2005-08-14 14:30:47 +00:00
parent c1c7bded8f
commit 79ae8d24e2
2 changed files with 12 additions and 12 deletions

View File

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

View File

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