From b328b5ebc10fdfeeff6424933cb6ba172c6c2cb8 Mon Sep 17 00:00:00 2001
From: diosmosis <benaka@piwik.pro>
Date: Tue, 4 Nov 2014 11:19:27 -0800
Subject: [PATCH] Do not display nb_users series in row evolution is no data
 for the metric.

---
 plugins/CoreHome/DataTableRowAction/RowEvolution.php | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/plugins/CoreHome/DataTableRowAction/RowEvolution.php b/plugins/CoreHome/DataTableRowAction/RowEvolution.php
index b0922f05bf..6f2db7ab9d 100644
--- a/plugins/CoreHome/DataTableRowAction/RowEvolution.php
+++ b/plugins/CoreHome/DataTableRowAction/RowEvolution.php
@@ -229,6 +229,14 @@ class RowEvolution
             list($first, $last) = $this->getFirstAndLastDataPointsForMetric($metric);
             $details = Piwik::translate('RowEvolution_MetricBetweenText', array($first, $last));
 
+            // TODO: this check should be determined by metric metadata, not hardcoded here
+            if ($metric == 'nb_users'
+                && $first == 0
+                && $last == 0
+            ) {
+                continue;
+            }
+
             if ($change !== false) {
                 $lowerIsBetter = Metrics::isLowerValueBetter($metric);
                 if (substr($change, 0, 1) == '+') {
-- 
GitLab