diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-12-19 17:13:25 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-12-19 17:15:31 +0000 |
commit | 89effa74e2fcb3e631a08102bed51744f705975c (patch) | |
tree | 96407b82e5987b82926e9e2bac10981af82e8cd3 | |
parent | 04bab134af19c481d9c10f8cec547ed4d1b983f4 (diff) |
Fix colour wrapping bug, where it only added red.
As colours.length increased as colours were added,
it would always return the first entry.
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | web/js/dashboard.js | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index e919ec113..6e7fade45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ * Unreleased - Bugfixes: - Make sure dashboard filters all fit onto one line. + - Fix issue with red bars on bar graph of many categories. * v2.3 (18th December 2017) - New features: diff --git a/web/js/dashboard.js b/web/js/dashboard.js index a6e06e048..b2a87c142 100644 --- a/web/js/dashboard.js +++ b/web/js/dashboard.js @@ -179,8 +179,8 @@ $(function(){ rowValues.push( parseInt($(this).find('td').text(), 10) ); }); - for (var i=colours.length; i<rowLabels.length; i++) { - colours[i] = colours[i % colours.length]; + for (var l=colours.length, i=l; i<rowLabels.length; i++) { + colours[i] = colours[i % l]; } var barChart = new Chart($canvas, { |