/** * Query vertical (y) axis * * @return SimpleQuery */ protected function queryYAxis() { if ($this->yAxisQuery === null) { $this->yAxisQuery = clone $this->baseQuery; $this->yAxisQuery->group($this->yAxisColumn); $this->yAxisQuery->columns(array($this->yAxisColumn)); $this->yAxisQuery->setUseSubqueryCount(); if ($this->yAxisFilter !== null) { $this->yAxisQuery->addFilter($this->yAxisFilter); } if (!$this->yAxisQuery->hasOrder($this->yAxisColumn)) { $this->yAxisQuery->order($this->yAxisColumn, 'asc'); } } return $this->yAxisQuery; }
/** * Query vertical (y) axis * * @return SimpleQuery */ protected function queryYAxis() { if ($this->yAxisQuery === null) { $this->yAxisQuery = clone $this->baseQuery; $yAxisHeader = $this->getYAxisHeader(); $columns = array($this->yAxisColumn, $yAxisHeader); $this->yAxisQuery->group(array_unique($columns)); // yAxisColumn and header may be the same column $this->yAxisQuery->columns($columns); if ($this->yAxisFilter !== null) { $this->yAxisQuery->addFilter($this->yAxisFilter); } $this->yAxisQuery->order($yAxisHeader, isset($this->order[$yAxisHeader]) ? $this->order[$yAxisHeader] : self::SORT_ASC); } return $this->yAxisQuery; }