function setScalar() { $maxValue = 100; $maxValue = max($maxValue, KChartGoogleHelper::getMaxOfArray(KChartGoogleHelper::addArrays($this->_data))); if ($maxValue < 100) { $this->_scalar = 1; } else { $this->_scalar = 100 / $maxValue; } }
protected function getDataSetString() { $fullDataSet = array_splice($this->_scaledValues[0], 0, 3); while (count($fullDataSet) < 3) { array_push($fullDataSet, 0); } $scaledIntersections = KChartGoogleHelper::getScaledArray($this->_intersections, $this->_scalar); foreach ($scaledIntersections as $temp) { array_push($fullDataSet, $temp); } $fullDataSet = array_splice($fullDataSet, 0, 7); while (count($fullDataSet) < 7) { array_push($fullDataSet, 0); } return "&chd=" . $this->_dataEncodingType . ":" . $this->encodeData($fullDataSet, "", ","); }
private function setBarWidth() { if (isset($this->barWidth)) { $this->realBarWidth = $this->barWidth; return; } $this->_setBarCount(); $totalGroups = KChartGoogleHelper::getMaxCountOfArray($this->_data); if ($this->isHoriz) { $chartSize = $this->_height - 50; } else { $chartSize = $this->_width - 50; } $chartSize -= $totalGroups * $this->_groupSpacerWidth; $this->realBarWidth = round($chartSize / $this->totalBars); }