From 020f0fa9d17628e91255b8328e3d10c0589b1421 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 17 Nov 2003 13:13:26 +0000 Subject: [PATCH] =?UTF-8?q?Int=E8gre=20le=20calcul=20du=20nombre=20de=20li?= =?UTF-8?q?gnes=20horizontales=20enti=E8res?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/graph.class.php | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/htdocs/graph.class.php b/htdocs/graph.class.php index 569be719134..c810b101314 100644 --- a/htdocs/graph.class.php +++ b/htdocs/graph.class.php @@ -59,7 +59,31 @@ class Graph if (isset($this->MaxValue)) { + $this->MaxValue = $this->MaxValue + 1; + $max = $this->MaxValue; + if (($max % 2) <> 0) + { + $this->MaxValue = $this->MaxValue + 1; + $max++; + } + $graph->SetPlotAreaWorld(0,0,12,$this->MaxValue); + + $j = 0; + for ($i = 1 ; $i < 11 ; $i++) + { + $res = $max % $i; + $cal = $max / $i; + if ($res == 0 && $cal <= 10) + { + $nts[$j] = $cal; + $j++; + } + + } + rsort($nts); + + $graph->SetNumVertTicks($nts[0]); } else { @@ -78,7 +102,7 @@ class Graph //Set some data $graph->SetDataValues($data); - $graph->SetVertTickIncrement(0); + // $graph->SetVertTickIncrement(0); $graph->SetDrawYGrid(1);