]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2200 Improve text positioning and colors
authorFabrice Bellingard <bellingard@gmail.com>
Thu, 8 Sep 2011 16:41:52 +0000 (18:41 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Thu, 8 Sep 2011 16:45:31 +0000 (18:45 +0200)
This is required to be able to read the values even when the mouse is
close to the borders

sonar-server/src/main/webapp/javascripts/protovis-sonar.js

index 41321cceac06f1444677999d737719b4ecad1675..f80836031b525c93e075c3a51504cb7bc6e33c10 100755 (executable)
@@ -124,11 +124,11 @@ SonarWidgets.StackArea.prototype.render = function() {
            .extend(area)
            .fillStyle(null)
            .strokeStyle(null)
-           .anchor(function() {return idx == 0 ? "left" : (idx == idx_numbers-1 ? "right" : "center");})
+           .anchor(function() {return (idx == idx_numbers-1 || vis.mouse().x > w*4/5) ? "right" : (vis.mouse().x < w/5 ? "left" : "center");})
            .add(pv.Label)
            .visible(function(d) {return this.index == idx && d.y != 0;})
            .font(function(d) { return Math.round(5 + Math.sqrt(y(d.y))) + "px sans-serif";})
-           .textStyle("#FFF")
+           .textStyle("#DDD")
            .text(function(d) {return metrics[this.parent.index] + ": " + d.y;});
        
        /* The total cost of the selected dot in the header. */