| @@ -282,11 +282,13 @@ | ||
| 282 | 282 | return $this->min_values[$dataset]; |
| 283 | 283 | |
| 284 | 284 | $min = null; |
| 285 | 285 | $key = $this->dataset_fields[$dataset]; |
| 286 | - foreach($this->data as $item) { | |
| 287 | - if(isset($item[$key]) && ($min === null || $item[$key] < $min)) | |
| 288 | - $min = $item[$key]; | |
| 286 | + if($key !== null) { | |
| 287 | + foreach($this->data as $item) { | |
| 288 | + if(isset($item[$key]) && ($min === null || $item[$key] < $min)) | |
| 289 | + $min = $item[$key]; | |
| 290 | + } | |
| 289 | 291 | } |
| 290 | 292 | |
| 291 | 293 | return ($this->min_values[$dataset] = $min); |
| 292 | 294 | } |
| @@ -300,11 +302,13 @@ | ||
| 300 | 302 | return $this->max_values[$dataset]; |
| 301 | 303 | |
| 302 | 304 | $max = null; |
| 303 | 305 | $key = $this->dataset_fields[$dataset]; |
| 304 | - foreach($this->data as $item) { | |
| 305 | - if(isset($item[$key]) && ($max === null || $item[$key] > $max)) | |
| 306 | - $max = $item[$key]; | |
| 306 | + if($key !== null) { | |
| 307 | + foreach($this->data as $item) { | |
| 308 | + if(isset($item[$key]) && ($max === null || $item[$key] > $max)) | |
| 309 | + $max = $item[$key]; | |
| 310 | + } | |
| 307 | 311 | } |
| 308 | 312 | |
| 309 | 313 | return ($this->max_values[$dataset] = $max); |
| 310 | 314 | } |