diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2014-10-09 14:32:14 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2014-10-09 14:32:14 +0200 |
commit | 2c71aa3039b173b800f0463c2d426b7a69a6fa20 (patch) | |
tree | 55259bb032281f19105e3a76024249b67afb5fe7 /server/sonar-web/src/main | |
parent | 45b9f6870c36040482930d73237d6d98a282f904 (diff) | |
download | sonarqube-2c71aa3039b173b800f0463c2d426b7a69a6fa20.tar.gz sonarqube-2c71aa3039b173b800f0463c2d426b7a69a6fa20.zip |
SONAR-5606 Timeline chart does not behave correctly when measures don't have the same history
Diffstat (limited to 'server/sonar-web/src/main')
-rw-r--r-- | server/sonar-web/src/main/js/widgets/timeline.js | 14 | ||||
-rw-r--r-- | server/sonar-web/src/main/less/style.less | 6 |
2 files changed, 17 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/widgets/timeline.js b/server/sonar-web/src/main/js/widgets/timeline.js index 23ab743cd23..3718852e1bd 100644 --- a/server/sonar-web/src/main/js/widgets/timeline.js +++ b/server/sonar-web/src/main/js/widgets/timeline.js @@ -153,6 +153,9 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets; .ticks(5); + this.showLimitHistoryMessage(); + + // Configure lines and points this.lines = []; this.glines = []; @@ -281,6 +284,17 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets; }; + window.SonarWidgets.Timeline.prototype.showLimitHistoryMessage = function () { + var minEvent = d3.min(this.events(), function (d) { + return d.d; + }), + minData = this.time.domain()[0]; + if (minEvent < minData) { + var maxResultsReachedLabel = this.container.append('div').text(this.limitedHistoricalData); + maxResultsReachedLabel.classed('max-results-reached-message', true); + } + }; + window.SonarWidgets.Timeline.prototype.update = function() { var widget = this, diff --git a/server/sonar-web/src/main/less/style.less b/server/sonar-web/src/main/less/style.less index 2d73427824a..d8638486ccb 100644 --- a/server/sonar-web/src/main/less/style.less +++ b/server/sonar-web/src/main/less/style.less @@ -2800,17 +2800,17 @@ div.rule-title { } } -.sonar-d3 .max-results-reached-message { +.max-results-reached-message { font-size: 12px; } -.sonar-d3 div.max-results-reached-message { +div.max-results-reached-message { margin-top: 10px; color: #777; text-align: center; } -.sonar-d3 text.max-results-reached-message { +text.max-results-reached-message { fill: #777; } |