public function FrxSVGGraph::validSeries in Forena Reports 7.4
1 call to FrxSVGGraph::validSeries()
- FrxSVGGraph::render in renderers/
FrxSVGGraph.inc - Render the graph.
File
- renderers/
FrxSVGGraph.inc, line 318
Class
Code
public function validSeries() {
$valid = TRUE;
$removed = array();
if (is_array($this->graphOptions['structure']['value'])) {
foreach ($this->graphOptions['structure']['value'] as $k => $series) {
if (!isset($this->counts[$series])) {
// remove empty series.
unset($this->graphOptions['structure']['value'][$k]);
$removed[] = $k;
}
}
if ($removed) {
$this->graphOptions['structure']['value'] = array_values($this->graphOptions['structure']['value']);
foreach ($this->graphOptions as $option => $data) {
if (is_array($data)) {
$modified = FALSE;
foreach ($removed as $k) {
if (isset($data[$k])) {
unset($this->graphOptions[$option][$k]);
$modified = TRUE;
}
}
if ($modified) {
$this->graphOptions[$option] = array_values($this->graphOptions[$option]);
}
}
}
if (!$this->graphOptions['structure']['value']) {
$valid = FALSE;
}
}
}
return $valid;
}