protected function getColorLegend() { $legend = ''; $period = $this->period; $statsTable = new StatsTable(); for ($i = 0; $i <= $period; $i += 30) { $iFormatted = htmlspecialchars($this->getLanguage()->formatNum($i)); $legend .= '<span style="background-color:#' . $statsTable->getBackgroundColor($period - $i, $period) . "\"> {$iFormatted}</span>"; } return $legend; }