From: Stas Vilchik Date: Thu, 21 Nov 2013 04:54:23 +0000 (+0600) Subject: Stack Area: place legend in 3 rows X-Git-Tag: 4.1-RC1~259 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=67fb89b56df1774269dccc643d36cf1dbf05732b;p=sonarqube.git Stack Area: place legend in 3 rows --- diff --git a/sonar-server/src/main/webapp/javascripts/widgets/stack-area.js b/sonar-server/src/main/webapp/javascripts/widgets/stack-area.js index d4b725c12e3..ac72d01ebf3 100644 --- a/sonar-server/src/main/webapp/javascripts/widgets/stack-area.js +++ b/sonar-server/src/main/webapp/javascripts/widgets/stack-area.js @@ -130,7 +130,7 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets; // Configure info this.infoWrap .attr('class', 'info') - .attr('transform', trans(0, -45)); + .attr('transform', trans(0, -60)); this.infoDate .attr('class', 'info-text info-text-bold') @@ -142,7 +142,7 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets; this.infoSnapshot .attr('class', 'info-text info-text-small') - .attr('transform', trans(0, 36)); + .attr('transform', trans(0, 54)); this.infoMetrics = []; var prevX = 110; @@ -162,12 +162,14 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets; // Align metric labels infoMetric .attr('transform', function() { - return trans(prevX, -1 + (i % 2) * 18); + return trans(prevX, -1 + (i % 3) * 18); }); widget.infoMetrics.push(infoMetric); - prevX += (infoMetricText.node().getComputedTextLength() + 80) * (i % 2); + if (i % 3 === 2) { + prevX += (infoMetricText.node().getComputedTextLength() + 60); + } }); @@ -328,7 +330,7 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets; window.SonarWidgets.StackArea.defaults = { width: 350, height: 150, - margin: { top: 65, right: 10, bottom: 40, left: 40 } + margin: { top: 80, right: 10, bottom: 40, left: 40 } };