From 4eaec62687e4be30c64d026041579d0c471204f5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gr=C3=A9goire=20Aubert?= Date: Wed, 16 Aug 2017 11:10:12 +0200 Subject: [PATCH] Fix wrong treemap legend for coverage measure --- .../src/main/js/components/charts/ColorGradientLegend.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/server/sonar-web/src/main/js/components/charts/ColorGradientLegend.js b/server/sonar-web/src/main/js/components/charts/ColorGradientLegend.js index 224170b67f0..e67d19644c9 100644 --- a/server/sonar-web/src/main/js/components/charts/ColorGradientLegend.js +++ b/server/sonar-web/src/main/js/components/charts/ColorGradientLegend.js @@ -43,13 +43,12 @@ export default function ColorGradientLegend( width } /*: Props */ ) { - let colorDomain = colorScale.domain(); - let colorRange = colorScale.range(); - if (direction !== 1) { - colorDomain = colorDomain.reverse(); - colorRange = colorRange.reverse(); + const colorRange = colorScale.range(); + if (direction === 1) { + colorRange.reverse(); } + const colorDomain = colorScale.domain(); const lastColorIdx = colorRange.length - 1; const lastDomainIdx = colorDomain.length - 1; const widthNoPadding = width - padding[1]; -- 2.39.5