/** * 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)); } }
/** * 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; } }
/** * 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}"); } } }
/** * 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'); } }
/** * 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'); } }
protected function CheckValues(&$values) { parent::CheckValues($values); if (count($values[0]) <= 1) { throw new Exception('Not enough values for line graph'); } }