aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrice Bellingard <bellingard@gmail.com>2011-09-13 09:29:28 +0200
committerFabrice Bellingard <bellingard@gmail.com>2011-09-13 09:29:28 +0200
commit5201a4e402dce01a473e177d414c97e8efd54217 (patch)
tree79297c0b7b340d330679d12a19f9d0d9452d2d26
parentfd3663f1268e5d86c002ce7c25780d01c6e8f143 (diff)
downloadsonarqube-5201a4e402dce01a473e177d414c97e8efd54217.tar.gz
sonarqube-5201a4e402dce01a473e177d414c97e8efd54217.zip
SONAR-2200 Improve algo to compute left margin width
-rwxr-xr-xsonar-server/src/main/webapp/javascripts/protovis-sonar.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/sonar-server/src/main/webapp/javascripts/protovis-sonar.js b/sonar-server/src/main/webapp/javascripts/protovis-sonar.js
index a79cdc4876e..95547a43268 100755
--- a/sonar-server/src/main/webapp/javascripts/protovis-sonar.js
+++ b/sonar-server/src/main/webapp/javascripts/protovis-sonar.js
@@ -64,7 +64,8 @@ SonarWidgets.StackArea.prototype.render = function() {
/* Computes minimum width of left margin according to the max Y value so that the Y-axis is correctly displayed */
var leftMargin = 25;
- minMargin = (Math.round(maxY) + "").length * 7;
+ var maxYLength = (Math.round(maxY) + "").length;
+ minMargin = maxYLength * 7 + Math.floor(maxYLength /3) * 2; // first part is for numbers and second for commas (1000-separator)
if (minMargin > leftMargin) { leftMargin = minMargin; }
/* Sizing and scales. */