From: Grégoire Aubert Date: Wed, 16 Aug 2017 09:10:12 +0000 (+0200) Subject: Fix wrong treemap legend for coverage measure X-Git-Tag: 6.6-RC1~581 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4eaec62687e4be30c64d026041579d0c471204f5;p=sonarqube.git Fix wrong treemap legend for coverage measure --- 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];