From 2c9ff74943c04463fa40feaf53fab9d56b05d9e4 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Wed, 9 Feb 2005 14:57:58 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20consolidation=20des=20donn=E9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stats/lignes/commandes.week.class.php | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/htdocs/telephonie/stats/lignes/commandes.week.class.php b/htdocs/telephonie/stats/lignes/commandes.week.class.php index a2da286b00f..91702a2f018 100644 --- a/htdocs/telephonie/stats/lignes/commandes.week.class.php +++ b/htdocs/telephonie/stats/lignes/commandes.week.class.php @@ -94,7 +94,40 @@ class GraphLignesCommandesWeek extends GraphBar { print $this->db->error() . ' ' . $sql; } - $this->GraphDraw($this->file, $datas, $labels); + $datas_new = array(); + $labels_new = array(); + $j = 0 ; + + $datas_new[0] = $datas[0]; + $labels_new[0] = ceil(substr($labels[0],-2)); + + for ($i = 1 ; $i < sizeof($labels) ; $i++) + { + if (substr($labels[$i], -2) - substr($labels[$i-1], -2) > 1) + { + for ($k = 1 ; $k < ($labels[$i] - $labels[$i-1]) ; $k++) + { + $datas_new[$i+$j] = 0; + $labels_new[$i+$j] = ceil(substr($labels[$i-1], -2) + $k) ; // suppression du 0 + + $j++; + } + } + + $datas_new[$i+$j] = $datas[$i]; + $labels_new[$i+$j] = ceil(substr($labels[$i], - 2)); + } + + $nbel = sizeof($datas_new); + + for ($i = 0 ; $i < ($nbel - 22) ; $i++) + { + array_shift($datas_new); + array_shift($labels_new); + } + + + $this->GraphDraw($this->file, $datas_new, $labels_new); } } ?>