// Fixed chart for period before the store creation

This commit is contained in:
Damien Metzger
2013-10-24 11:17:33 +02:00
parent d173b2d4cd
commit a34784a15d
2 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -125,7 +125,7 @@ UPDATE `PREFIX_hook_module` SET position = 5
WHERE id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'blockmyaccountfooter')
AND id_hook = @id_hook;
UPDATE `PREFIX_hook_module` SET position = 3
UPDATE `PREFIX_hook_module` SET position = 6
WHERE id_module = (SELECT id_module FROM `PREFIX_module` WHERE name = 'blockcontactinfos')
AND id_hook = @id_hook;
+6 -3
View File
@@ -238,15 +238,18 @@ class Dashtrends extends Module
$chart_data = array();
foreach (array_keys($this->dashboard_data) as $chart_key)
{
$calibration = array_sum($this->dashboard_data[$chart_key]) / count($this->dashboard_data[$chart_key]);
$chart_data[$chart_key] = $chart_data_compare[$chart_key] = array();
if (!$count = count($this->dashboard_data[$chart_key]))
continue;
$calibration = array_sum($this->dashboard_data[$chart_key]) / $count;
$chart_data[$chart_key] = array();
foreach ($this->dashboard_data[$chart_key] as $key => $value)
$chart_data[$chart_key][] = array(1000 * $key, $calibration ? 100 * $value / $calibration : 0);
if ($this->dashboard_data_compare)
{
$chart_data_compare[$chart_key] = array();
foreach ($this->dashboard_data_compare[$chart_key] as $key => $value)
$chart_data_compare[$chart_key][] = array(1000 * $key, $calibration ? 100 * $value / $calibration : 0);
}