From 44621be7dcebc81bc8a5ad416d48a8433b72a41b Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Mon, 29 Aug 2011 14:46:58 +0200 Subject: SONAR-2074 Remove y-axis on the chart --- .../src/main/webapp/javascripts/protovis-sonar.js | 29 +++------------------- 1 file changed, 3 insertions(+), 26 deletions(-) (limited to 'sonar-server/src/main') diff --git a/sonar-server/src/main/webapp/javascripts/protovis-sonar.js b/sonar-server/src/main/webapp/javascripts/protovis-sonar.js index 18c3d627ef6..28e8aba5011 100755 --- a/sonar-server/src/main/webapp/javascripts/protovis-sonar.js +++ b/sonar-server/src/main/webapp/javascripts/protovis-sonar.js @@ -44,23 +44,11 @@ SonarWidgets.Timeline.prototype.render = function() { var widgetDiv = document.getElementById(this.wDivId); var footerFont = "12px Arial,Helvetica,sans-serif"; + var show_y_axis = (data.length==1) /* Sizing and scales. */ - var leftMargin = 20; - var show_y_axis = (data.length==1) - if (show_y_axis) { - // We must evaluate how wide the left margin must be, depending on the values that we get (so that they can be displayed correctly) - var maxNumberOnY = 0; - for (var i = 0; i < trendData.length; i++) { - for (var j = 0; j < trendData[i].length; j++) { - if (trendData[i][j].y > maxNumberOnY) { maxNumberOnY = trendData[i][j].y; } - } - } - minMargin = (maxNumberOnY + "").length * 7; - if (minMargin > leftMargin) { leftMargin = minMargin; } - } var footerHeight = 30 + (events ? 3 : this.wMetrics.size()) * 12; - var w = widgetDiv.parentNode.clientWidth - leftMargin - 30, + var w = widgetDiv.parentNode.clientWidth - 60, h = (this.wHeight == null ? 80 : this.wHeight) + footerHeight - 5, S=2; @@ -77,7 +65,7 @@ SonarWidgets.Timeline.prototype.render = function() { .canvas(widgetDiv) .width(w) .height(h) - .left(leftMargin) + .left(20) .right(20) .bottom(footerHeight) .top(5) @@ -93,17 +81,6 @@ SonarWidgets.Timeline.prototype.render = function() { .add(pv.Label) .text(x.tickFormat); - /* Y-axis and ticks. */ - if (show_y_axis) { - vis.add(pv.Rule) - .data(y[0].ticks(5)) - .bottom(y[0]) - .strokeStyle(function(d) {return d ? "#eee" : "#000";}) - .anchor("left") - .add(pv.Label) - .text(y[0].tickFormat); - } - /* A panel for each data series. */ var panel = vis.add(pv.Panel) .data(trendData); -- cgit v1.2.3