private function getPercentage($popularity, $maxValue) { // case hideFutureHoursWhenToday=1 shows hours with no visits if ($maxValue == 0) { return 0; } $percent = $popularity / $maxValue * 100; return $percent; }