コード例 #1
0
 /**
  * Line graphs and lines in general require at least two points
  */
 protected function CheckValues()
 {
     parent::CheckValues();
     if ($this->values->ItemsCount() <= 1) {
         throw new Exception('Not enough values for ' . get_class($this));
     }
 }
コード例 #2
0
 /**
  * Checks that the data produces a 2-D plot
  */
 protected function CheckValues()
 {
     parent::CheckValues();
     // using force_assoc makes things work properly
     if ($this->values->AssociativeKeys()) {
         $this->force_assoc = true;
     }
 }
コード例 #3
0
 /**
  * Checks that the data produces a 2-D plot
  */
 protected function CheckValues(&$values)
 {
     parent::CheckValues($values);
     foreach ($values[0] as $key => $v) {
         if (is_numeric($key) && $key > 0) {
             return;
         }
     }
     throw new Exception('No valid data keys for scatter graph');
 }
 /**
  * Checks that the data contains sensible values
  */
 protected function CheckValues()
 {
     parent::CheckValues();
     foreach ($this->values[0] as $item) {
         if (is_null($item->value)) {
             continue;
         }
         $wb = $item->Data('wbottom');
         $wt = $item->Data('wtop');
         $b = $item->Data('bottom');
         $t = $item->Data('top');
         if ($wb > $b || $wt < $t || $item->value < $b || $item->value > $t) {
             throw new Exception("Data problem: {$wb} {$b} {$item->value} {$t} {$wt}");
         }
     }
 }
コード例 #5
0
ファイル: SVGGraphRadarGraph.php プロジェクト: gotcms/gotcms
 /**
  * Need at least two values and no negative values
  */
 protected function CheckValues(&$values)
 {
     parent::CheckValues($values);
     if (count($values[0]) < 2) {
         throw new Exception('Not enough values for radar graph');
     }
     if ($this->GetMinValue() < 0) {
         throw new Exception('Negative value for radar graph');
     }
 }
コード例 #6
0
 /**
  * Requires at least two values
  */
 protected function CheckValues(&$values)
 {
     parent::CheckValues($values);
     if ($this->GetHorizontalCount() < 2) {
         throw new Exception('Not enough values for line graph');
     }
 }
コード例 #7
0
ファイル: SVGGraphLineGraph.php プロジェクト: gotcms/gotcms
 protected function CheckValues(&$values)
 {
     parent::CheckValues($values);
     if (count($values[0]) <= 1) {
         throw new Exception('Not enough values for line graph');
     }
 }