diff --git a/classes/module/ModuleGraph.php b/classes/module/ModuleGraph.php index f74e66146..190787bfe 100644 --- a/classes/module/ModuleGraph.php +++ b/classes/module/ModuleGraph.php @@ -77,6 +77,7 @@ abstract class ModuleGraphCore extends Module if (is_callable(array($this, 'setDayValues'))) { $this->setDayValues($layers); } + $this->_titles['x'][] = $this->l('Time'); } // If the granularity is inferior to 1 month // @TODO : change to manage 28 to 31 days @@ -110,6 +111,7 @@ abstract class ModuleGraphCore extends Module if (is_callable(array($this, 'setMonthValues'))) { $this->setMonthValues($layers); } + $this->_titles['x'][] = $this->l('Date'); } // If the granularity is less than 1 year elseif (strtotime('-1 year', strtotime($this->_employee->stats_date_to)) < strtotime($this->_employee->stats_date_from)) { @@ -141,6 +143,7 @@ abstract class ModuleGraphCore extends Module if (is_callable(array($this, 'setYearValues'))) { $this->setYearValues($layers); } + $this->_titles['x'][] = $this->l('Month'); } // If the granularity is greater than 1 year else { @@ -163,6 +166,7 @@ abstract class ModuleGraphCore extends Module if (is_callable(array($this, 'setAllTimeValues'))) { $this->setAllTimeValues($layers); } + $this->_titles['x'][] = $this->l('Year'); } } diff --git a/modules/statsproduct/statsproduct.php b/modules/statsproduct/statsproduct.php index 2ec1bdce5..8a7051421 100644 --- a/modules/statsproduct/statsproduct.php +++ b/modules/statsproduct/statsproduct.php @@ -358,7 +358,6 @@ class StatsProduct extends ModuleGraph } $this->_titles['main'][] = $this->l('Room nights'); $this->_titles['main'][] = $this->l('Views (x100)'); - $this->_titles['x'] = $this->l('Date'); $this->_titles['y'] = $this->l('Room nights, Views (x100)'); $this->_formats['y'] = 'd'; diff --git a/modules/statsregistrations/statsregistrations.php b/modules/statsregistrations/statsregistrations.php index 430ddc07c..ea6ff5750 100644 --- a/modules/statsregistrations/statsregistrations.php +++ b/modules/statsregistrations/statsregistrations.php @@ -190,7 +190,6 @@ class StatsRegistrations extends ModuleGraph protected function setYearValues($layers) { - $this->_titles['x'][] = $this->l('Month'); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->query.$this->getDate()); foreach ($result as $row) { $mounth = (int)substr($row['date_add'], 5, 2); @@ -203,7 +202,6 @@ class StatsRegistrations extends ModuleGraph protected function setMonthValues($layers) { - $this->_titles['x'][] = $this->l('Date'); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->query.$this->getDate()); foreach ($result as $row) { $this->_values[(int)Tools::substr($row['date_add'], 8, 2)]++; @@ -212,7 +210,6 @@ class StatsRegistrations extends ModuleGraph protected function setDayValues($layers) { - $this->_titles['x'][] = $this->l('Time'); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->query.$this->getDate()); foreach ($result as $row) { $this->_values[(int)Tools::substr($row['date_add'], 11, 2)]++;