From 53bd113e3d34e9c824a14ca3d388b467b8a1de29 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Wed, 4 Dec 2013 17:54:54 +0600 Subject: Cycle colors in stack area chart --- sonar-server/src/main/webapp/javascripts/widgets/stack-area.js | 5 +++-- 1 file 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 -- cgit v1.2.3