diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2013-12-04 17:54:54 +0600 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2013-12-04 17:54:54 +0600 |
commit | 53bd113e3d34e9c824a14ca3d388b467b8a1de29 (patch) | |
tree | 2282d9ab658b8bd02d47f71cd8a8827b15999a96 | |
parent | 57a079b777822bed140b5e7cd38f043e1137f6bf (diff) | |
download | sonarqube-53bd113e3d34e9c824a14ca3d388b467b8a1de29.tar.gz sonarqube-53bd113e3d34e9c824a14ca3d388b467b8a1de29.zip |
Cycle colors in stack area chart
-rw-r--r-- | sonar-server/src/main/webapp/javascripts/widgets/stack-area.js | 5 |
1 files changed, 3 insertions, 2 deletions
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 ac72d01ebf3..081a05ac6a3 100644 --- a/sonar-server/src/main/webapp/javascripts/widgets/stack-area.js +++ b/sonar-server/src/main/webapp/javascripts/widgets/stack-area.js @@ -55,7 +55,8 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets; }; window.SonarWidgets.StackArea.prototype.render = function () { - var widget = this; + var widget = this, + cl = widget.colors().length; this.svg = this.container.append('svg') .attr('class', 'sonar-d3'); @@ -100,7 +101,7 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets; .domain([0, d3.max(this.stackDataTop, function(d) { return d.y0 + d.y; })]) .nice(); - this.color = function(i) { return widget.colors()[i][0]; }; + this.color = function(i) { return widget.colors()[i % cl][0]; }; // Configure the axis |