コード例 #1
0
ファイル: stacked.php プロジェクト: enormego/EightPHP
 function setScalar()
 {
     $maxValue = 100;
     $maxValue = max($maxValue, gchartutil::getMaxOfArray(gchartutil::addArrays($this->values)));
     if ($maxValue < 100) {
         $this->scalar = 1;
     } else {
         $this->scalar = 100 / $maxValue;
     }
 }
コード例 #2
0
ファイル: gchartutil.php プロジェクト: enormego/EightPHP
 public static function getMaxOfArray($ArrayToCheck)
 {
     $maxValue = 1;
     foreach ($ArrayToCheck as $temp) {
         if (is_array($temp)) {
             $maxValue = max($maxValue, gchartutil::getMaxOfArray($temp));
         } else {
             $maxValue = max($maxValue, $temp);
         }
     }
     return $maxValue;
 }
コード例 #3
0
ファイル: bar.php プロジェクト: enormego/EightPHP
 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);
 }
コード例 #4
0
ファイル: venndiagram.php プロジェクト: enormego/EightPHP
 protected function getDataSetString()
 {
     $fullDataSet = array_splice($this->scaledValues[0], 0, 3);
     while (count($fullDataSet) < 3) {
         array_push($fullDataSet, 0);
     }
     $scaledIntersections = gchartutil::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, "", ",");
 }