public static function getMaxCountOfArray($ArrayToCheck) { $maxValue = count($ArrayToCheck); foreach ($ArrayToCheck as $temp) { if (is_array($temp)) { $maxValue = max($maxValue, gchartutil::getMaxCountOfArray($temp)); } } return $maxValue; }
private function setBarWidth() { if (isset($this->barWidth)) { $this->realBarWidth = $this->barWidth; return; } $this->setBarCount(); $totalGroups = gchartutil::getMaxCountOfArray($this->values); if ($this->isHoriz) { $chartSize = $this->height - 50; } else { $chartSize = $this->width - 50; } $chartSize -= $totalGroups * $this->groupSpacerWidth; $this->realBarWidth = round($chartSize / $this->totalBars); }
public function setBarCount() { $this->totalBars = gchartutil::getMaxCountOfArray($this->values); }