From 06cc2d3419110eaaca9486ffd010b9bd72f0deca Mon Sep 17 00:00:00 2001 From: mattpiwik Date: Tue, 27 Sep 2011 08:15:16 +0000 Subject: [PATCH] Fixes #2636 git-svn-id: http://dev.piwik.org/svn/trunk@5237 59fd770c-687e-43c8-a1e3-f5a4ff64c105 --- core/Visualization/Cloud.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/Visualization/Cloud.php b/core/Visualization/Cloud.php index f7f20b10630..adf4a7c7dda 100644 --- a/core/Visualization/Cloud.php +++ b/core/Visualization/Cloud.php @@ -56,7 +56,16 @@ public function render() { $wordTruncated = substr($word, 0, $this->truncatingLimit - 3).'...'; } - $percent = ($popularity / $maxValue) * 100; + + // case hideFutureHoursWhenToday=1 shows hours with no visits + if($maxValue == 0) + { + $percent = 0; + } + else + { + $percent = ($popularity / $maxValue) * 100; + } // CSS style value $sizeRange = $this->getClassFromPercent($percent);