Modification de l'échelle des graphs
This commit is contained in:
parent
c1c7bded8f
commit
79ae8d24e2
@ -154,7 +154,7 @@ if ($resql_c)
|
|||||||
$width = 750;
|
$width = 750;
|
||||||
$height = 300;
|
$height = 300;
|
||||||
$graph = new Graph($width, $height,"auto");
|
$graph = new Graph($width, $height,"auto");
|
||||||
$graph->SetScale("textlin",0,$maxa);
|
$graph->SetScale("textlin");
|
||||||
|
|
||||||
$graph->yaxis->scale->SetGrace(2);
|
$graph->yaxis->scale->SetGrace(2);
|
||||||
$graph->SetFrame(1);
|
$graph->SetFrame(1);
|
||||||
@ -178,7 +178,7 @@ if ($resql_c)
|
|||||||
$width = 300;
|
$width = 300;
|
||||||
$height = 90;
|
$height = 90;
|
||||||
$graph = new Graph($width, $height,"auto");
|
$graph = new Graph($width, $height,"auto");
|
||||||
$graph->SetScale("textlin",0,$maxa);
|
$graph->SetScale("textlin");
|
||||||
|
|
||||||
$graph->yaxis->scale->SetGrace(2);
|
$graph->yaxis->scale->SetGrace(2);
|
||||||
$graph->SetFrame(1);
|
$graph->SetFrame(1);
|
||||||
|
|||||||
@ -34,13 +34,6 @@ include_once (JPGRAPH_DIR."jpgraph_canvas.php");
|
|||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$labels = array();
|
|
||||||
$datas = array();
|
|
||||||
|
|
||||||
$ydatas = array();
|
|
||||||
$mdatas = array();
|
|
||||||
$wdatas = array();
|
|
||||||
|
|
||||||
$sql_c = "SELECT rowid";
|
$sql_c = "SELECT rowid";
|
||||||
$sql_c .= " FROM ".MAIN_DB_PREFIX."energie_compteur";
|
$sql_c .= " FROM ".MAIN_DB_PREFIX."energie_compteur";
|
||||||
|
|
||||||
@ -59,6 +52,14 @@ if ($resql_c)
|
|||||||
|
|
||||||
$compteur_id = $obj_c->rowid;
|
$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 = "SELECT ".$db->pdate("date_releve")." as date_releve, valeur";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."energie_compteur_releve";
|
$sql .= " FROM ".MAIN_DB_PREFIX."energie_compteur_releve";
|
||||||
$sql .= " WHERE fk_compteur = ".$obj_c->rowid;
|
$sql .= " WHERE fk_compteur = ".$obj_c->rowid;
|
||||||
@ -120,7 +121,6 @@ if ($resql_c)
|
|||||||
// Graph
|
// Graph
|
||||||
$maxa = 0;
|
$maxa = 0;
|
||||||
|
|
||||||
|
|
||||||
for ($i = 1 ; $i < sizeof($datas) ; $i++)
|
for ($i = 1 ; $i < sizeof($datas) ; $i++)
|
||||||
{
|
{
|
||||||
$xa = ($datas[$i][0] - $datas[($i-1)][0]);
|
$xa = ($datas[$i][0] - $datas[($i-1)][0]);
|
||||||
@ -148,8 +148,8 @@ if ($resql_c)
|
|||||||
if (sizeof($gdatas) > 2)
|
if (sizeof($gdatas) > 2)
|
||||||
{
|
{
|
||||||
$graph = new Graph($width, $height,"auto");
|
$graph = new Graph($width, $height,"auto");
|
||||||
$graph->SetScale("textlin",0,$maxa);
|
|
||||||
|
|
||||||
|
$graph->SetScale("textlin");
|
||||||
$graph->yaxis->scale->SetGrace(2);
|
$graph->yaxis->scale->SetGrace(2);
|
||||||
$graph->SetFrame(1);
|
$graph->SetFrame(1);
|
||||||
$graph->img->SetMargin(40,20,20,35);
|
$graph->img->SetMargin(40,20,20,35);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user