diff options
author | mattpiwik <matthieu.aubry@gmail.com> | 2012-09-28 07:07:18 +0400 |
---|---|---|
committer | mattpiwik <matthieu.aubry@gmail.com> | 2012-09-28 07:07:18 +0400 |
commit | 976b471ec73c6ba313775d15bbfc5ac0b26459be (patch) | |
tree | eb24f2a1df6f6b00e50be06a16ceb1441213a3dc | |
parent | f90da5ade2720a3fc568f78e9b498a9e615e0cf8 (diff) |
Refs #2159
* Fixing RowEvolution popover click on selector: Warning:</strong> <i>array_keys() expects parameter 1 to be array, null given</i>
* Changing default monthly to show 2 years history
* Simplifying code of getXAxisStepSize() since it seemed too complicated ;)
* removing incorrect title which was always "Showing evolution over last 30 $period"
git-svn-id: http://dev.piwik.org/svn/trunk@7075 59fd770c-687e-43c8-a1e3-f5a4ff64c105
-rw-r--r-- | core/ViewDataTable/GenerateGraphData/ChartEvolution.php | 32 | ||||
-rw-r--r-- | core/ViewDataTable/GenerateGraphHTML/ChartEvolution.php | 2 | ||||
-rw-r--r-- | lang/en.php | 1 | ||||
-rw-r--r-- | plugins/CoreHome/DataTableRowAction/RowEvolution.php | 6 | ||||
-rw-r--r-- | plugins/VisitsSummary/templates/index.tpl | 5 |
5 files changed, 10 insertions, 36 deletions
diff --git a/core/ViewDataTable/GenerateGraphData/ChartEvolution.php b/core/ViewDataTable/GenerateGraphData/ChartEvolution.php index b66e334ee0..fc4d9246cf 100644 --- a/core/ViewDataTable/GenerateGraphData/ChartEvolution.php +++ b/core/ViewDataTable/GenerateGraphData/ChartEvolution.php @@ -313,8 +313,8 @@ class Piwik_ViewDataTable_GenerateGraphData_ChartEvolution extends Piwik_ViewDat private function getXAxisStepSize( $periodLabel, $countGraphElements ) { - // For Custom Date Range, when the number of elements plotted can be small, make sure the X legend is useful - if ($countGraphElements <= 3) + // when the number of elements plotted can be small, make sure the X legend is useful + if ($countGraphElements <= 7) { return 1; } @@ -322,44 +322,16 @@ class Piwik_ViewDataTable_GenerateGraphData_ChartEvolution extends Piwik_ViewDat switch ($periodLabel) { case 'day': - if ($countGraphElements <= 9) - { - $steps = 4; - } - else - { $steps = 5; - } break; case 'week': - if ($countGraphElements <= 4) - { - return 2; - } - else - { $steps = 4; - } break; case 'month': - if ($countGraphElements <= 6) - { - return 2; - } - else - { $steps = 5; - } break; case 'year': - if ($countGraphElements <= 10) - { - return 2; - } - else - { $steps = 5; - } break; default: $steps = 5; diff --git a/core/ViewDataTable/GenerateGraphHTML/ChartEvolution.php b/core/ViewDataTable/GenerateGraphHTML/ChartEvolution.php index 4209b78fca..03244b8426 100644 --- a/core/ViewDataTable/GenerateGraphHTML/ChartEvolution.php +++ b/core/ViewDataTable/GenerateGraphHTML/ChartEvolution.php @@ -178,7 +178,7 @@ class Piwik_ViewDataTable_GenerateGraphHTML_ChartEvolution extends Piwik_ViewDat case 'week': return 26; case 'month': - return 12; + return 24; case 'year': return 5; case 'day': diff --git a/lang/en.php b/lang/en.php index a3cf6fc6de..c346bac8c7 100644 --- a/lang/en.php +++ b/lang/en.php @@ -1588,7 +1588,6 @@ And thank you for using Piwik!', 'VisitsSummary_MaxNbActions' => '%s max actions in one visit', 'VisitsSummary_NbActionsPerVisit' => '%s actions (page views, downloads and outlinks) per visit', 'VisitsSummary_NbVisitsBounced' => '%s visits have bounced (left the website after one page)', - 'VisitsSummary_EvolutionOverLastPeriods' => 'Evolution over the last %s %s', 'VisitsSummary_GenerateTime' => '%s seconds to generate the page', 'VisitsSummary_GenerateQueries' => '%s queries executed', 'VisitsSummary_WidgetLastVisits' => 'Visits Over Time', diff --git a/plugins/CoreHome/DataTableRowAction/RowEvolution.php b/plugins/CoreHome/DataTableRowAction/RowEvolution.php index 99efec780b..aeff341877 100644 --- a/plugins/CoreHome/DataTableRowAction/RowEvolution.php +++ b/plugins/CoreHome/DataTableRowAction/RowEvolution.php @@ -182,7 +182,11 @@ class Piwik_CoreHome_DataTableRowAction_RowEvolution $view = Piwik_ViewDataTable::factory($this->graphType); $view->setDataTable($this->dataTable); $view->init('CoreHome', 'getRowEvolutionGraph', $this->apiMethod); - $view->setColumnsToDisplay(array_keys($this->graphMetrics)); + + if(!empty($this->graphMetrics)) // In row Evolution popover, this is empty + { + $view->setColumnsToDisplay(array_keys($this->graphMetrics)); + } $view->hideAllViewsIcons(); foreach ($this->availableMetrics as $metric => $metadata) diff --git a/plugins/VisitsSummary/templates/index.tpl b/plugins/VisitsSummary/templates/index.tpl index b1b149b9bb..43c7097911 100644 --- a/plugins/VisitsSummary/templates/index.tpl +++ b/plugins/VisitsSummary/templates/index.tpl @@ -1,9 +1,8 @@ {* This graphId must be unique for this report *} <a name="evolutionGraph" graphId="VisitsSummarygetEvolutionGraph"></a> -<h2>{if $period=='range'}{'Referers_Evolution'|translate} - {else}{'VisitsSummary_EvolutionOverLastPeriods'|translate:'30':$periodsNames.$period.plural}{/if} -</h2> +<h2>{'Referers_Evolution'|translate}</h2> + {$graphEvolutionVisitsSummary} <h2>{'General_Report'|translate}</h2> |