date from controller) */ public function __construct($idSite, $date) { $this->metric = Common::getRequestVar('column', '', 'string'); parent::__construct($idSite, $date); } protected function loadEvolutionReport($column = false) { // set the "column" parameter for the API.getRowEvolution call parent::loadEvolutionReport($this->metric); } protected function extractEvolutionReport($report) { $this->metric = $report['column']; $this->dataTable = $report['reportData']; $this->availableMetrics = $report['metadata']['metrics']; $this->metricsForSelect = $report['metadata']['columns']; $this->dimension = $report['metadata']['dimension']; } /** * Render the popover * @param \Piwik\Plugins\CoreHome\Controller $controller * @param \Piwik\View (the popover_rowevolution template) */ public function renderPopover($controller, $view) { // add data for metric select box $view->availableMetrics = $this->metricsForSelect; $view->selectedMetric = $this->metric; $view->availableRecordsText = $this->dimension . ': ' . Piwik::translate('RowEvolution_ComparingRecords', array(count($this->availableMetrics))); return parent::renderPopover($controller, $view); } protected function getRowEvolutionGraphFromController(\Piwik\Plugins\CoreHome\Controller $controller) { // the row evolution graphs should not compare serieses return Context::executeWithQueryParameters(['compareSegments' => [], 'comparePeriods' => [], 'compareDates' => []], function () use ($controller) { return parent::getRowEvolutionGraphFromController($controller); }); } public function getRowEvolutionGraph($graphType = false, $metrics = false) { // the row evolution graphs should not compare serieses return Context::executeWithQueryParameters(['compareSegments' => [], 'comparePeriods' => [], 'compareDates' => []], function () use ($graphType, $metrics) { return parent::getRowEvolutionGraph($graphType, $metrics); }); } protected function getSparkline($metric) { // the row evolution graphs should not compare serieses return Context::executeWithQueryParameters(['compareSegments' => [], 'comparePeriods' => [], 'compareDates' => []], function () use ($metric) { return parent::getSparkline($metric); }); } }