/**
* Checks that the data are valid
*/
protected function CheckValues()
{
parent::CheckValues();
if ($this->GetMinValue() < 0) {
throw new Exception('Negative value for pie chart');
}
$sum = 0;
foreach ($this->values[0] as $item) {
$sum += $item->value;
}
if ($sum <= 0) {
throw new Exception('Empty pie chart');
}
$this->total = $sum;
}