From 4ddba193c9188acab4bfe236eb4b4f423982132a Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Thu, 9 Jan 2014 12:25:29 +0600 Subject: [PATCH] Labels of axis on pie and bubbles --- .../main/webapp/javascripts/widgets/bubble-chart.js | 4 ++-- .../src/main/webapp/javascripts/widgets/pie-chart.js | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/sonar-server/src/main/webapp/javascripts/widgets/bubble-chart.js b/sonar-server/src/main/webapp/javascripts/widgets/bubble-chart.js index 0299e8930c6..861d09a3616 100644 --- a/sonar-server/src/main/webapp/javascripts/widgets/bubble-chart.js +++ b/sonar-server/src/main/webapp/javascripts/widgets/bubble-chart.js @@ -228,7 +228,7 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets; .orient('bottom'); this.gxAxisLabel = this.gxAxis.append('text') - .text(this.metrics().x) + .text(this.metrics()[this.xMetric].name) .style('font-weight', 'bold') .style('text-anchor', 'middle'); @@ -241,7 +241,7 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets; this.gyAxis.attr('transform', trans(60 - this.margin().left, 0)); this.gyAxisLabel = this.gyAxis.append('text') - .text(this.metrics().y) + .text(this.metrics()[this.yMetric].name) .style('font-weight', 'bold') .style('text-anchor', 'middle'); diff --git a/sonar-server/src/main/webapp/javascripts/widgets/pie-chart.js b/sonar-server/src/main/webapp/javascripts/widgets/pie-chart.js index d1556b52752..4c625a87f0d 100644 --- a/sonar-server/src/main/webapp/javascripts/widgets/pie-chart.js +++ b/sonar-server/src/main/webapp/javascripts/widgets/pie-chart.js @@ -146,7 +146,6 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets; this.donutLabel2 = this.plotWrap.append('text') .style('text-anchor', 'middle') - .style('opacity', 0) .text(this.metrics()[this.mainMetric].name); @@ -248,8 +247,8 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets; this.donutLabel2 .transition() - .style('font-size', (this.radius / 10) + 'px') - .attr('transform', trans(0, this.radius / 6)); + .attr('transform', trans(0, widget.radius / 20)) + .style('font-size', (this.radius / 10) + 'px'); // Configure events @@ -277,7 +276,9 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets; widget.donutLabel .style('opacity', 1); widget.donutLabel2 - .style('opacity', 1); + .transition() + .attr('dy', '0') + .attr('transform', trans(0, widget.radius / 6)); widget.plotWrap .classed('hover', true); sector. @@ -297,7 +298,8 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets; .style('opacity', 0) .text(''); widget.donutLabel2 - .style('opacity', 0); + .transition() + .attr('transform', trans(0, widget.radius / 20)); widget.plotWrap .classed('hover', false); sector. -- 2.39.5