Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiosmosis <diosmosis@users.noreply.github.com>2019-11-18 11:09:10 +0300
committerGitHub <noreply@github.com>2019-11-18 11:09:10 +0300
commit21b49c1358cccc2ca92133be17021083d75f98ee (patch)
treeb6a8b09a548d1c586536eefa3c6a9556ceb052c9 /plugins/CoreVisualizations/templates
parent60009312a44f1aa728a0f9f6f7e0a8a59068544d (diff)
Invert change comparison when displaying percents in the UI … (#15098)
* Invert change comparison when displaying percents in the UI, and add extra _change_from metric to support API calculation of from change percent when there are more than two periods. * Update bandwidth submodule * update screenshots * Update tests. * Update screenshot.
Diffstat (limited to 'plugins/CoreVisualizations/templates')
-rw-r--r--plugins/CoreVisualizations/templates/_dataTableViz_htmlTable_comparisons.twig3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/CoreVisualizations/templates/_dataTableViz_htmlTable_comparisons.twig b/plugins/CoreVisualizations/templates/_dataTableViz_htmlTable_comparisons.twig
index 2a5852b21f..3ad571d9aa 100644
--- a/plugins/CoreVisualizations/templates/_dataTableViz_htmlTable_comparisons.twig
+++ b/plugins/CoreVisualizations/templates/_dataTableViz_htmlTable_comparisons.twig
@@ -1,6 +1,6 @@
{% if properties.columns_to_display is not empty %}
{% set lastSeenComparePeriod = false %}
-{% set comparedPeriodPretty = dataTable.getFirstRow().getMetadata('comparePeriodPretty') %}
+{% set comparedPeriodPretty = (dataTable.getRows()|last).getMetadata('comparePeriodPretty') %}
{% set isComparingSegments = rootDataTable.getMetadata('compareSegments')|default([])|length > 1 %}
{% set isComparingPeriods = rootDataTable.getMetadata('comparePeriods')|default([])|length > 1 %}
{%- for rowId, row in dataTable.getRows() -%}
@@ -56,6 +56,7 @@
{% set comparisonTooltipSuffix = '' %}
{% set columnChange = false %}
+
{% if row.getColumn(column ~ '_change')|default is not empty %}
{% set columnChange = row.getColumn(column ~ '_change')|default('+0%') %}
{% set comparisonTooltipSuffix = 'General_ComparisonRatioTooltip'|translate(columnChange, row.getMetadata('compareSegmentPretty'), comparedPeriodPretty) %}