aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties2
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/bubbleChart.html.erb92
-rw-r--r--sonar-server/src/main/webapp/javascripts/bubble-chart.js10
3 files changed, 55 insertions, 49 deletions
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
index 83e03d83962..022d33b2eae 100644
--- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
+++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
@@ -1035,7 +1035,7 @@ widget.timeline.property.hideEvents.name=Hide events
widget.timeline.property.chartHeight.name=Chart height
widget.bubble_chart.name=Bubble Chart
-widget.bubble_chart.description=Display all source files of a component in a Bubble chart. Three axes are configurable: X, Y and size of the bubbles.
+widget.bubble_chart.description=Display a component's source files in a Bubble chart. Both axes and bubble size are configurable.
widget.bubble_chart.property.chartTitle.name=Chart Title
widget.bubble_chart.property.xMetric.name=X Metric
widget.bubble_chart.property.yMetric.name=Y Metric
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/bubbleChart.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/bubbleChart.html.erb
index 72f6b773944..c16fc1de9ec 100644
--- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/bubbleChart.html.erb
+++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/bubbleChart.html.erb
@@ -9,63 +9,63 @@
chartTitle = widget_properties["chartTitle"]
%>
-<% if chartTitle %>
- <h3 style="text-align: center;"><%= h(chartTitle) -%></h3>
-<% end %>
-
<div class="bubble-chart-widget" id="<%= container_id %>">
+ <!--[if lte IE 8 ]> <h3><%= message('widget.unsupported_browser_warning') -%></h3> <![endif]-->
+ <!--[if (gt IE 9)|!(IE)]><!-->
+ <% if chartTitle %>
+ <h3 style="text-align: center;"><%= h(chartTitle) -%></h3>
+ <% end %>
+ <!--<![endif]-->
</div>
+<!--[if (gt IE 9)|!(IE)]><!-->
<script>
- if (window.d3 != null) {
- var bubbleChartData = [
- <%
- filter = MeasureFilter.new
- filter.criteria = {:qualifiers => ['FIL', 'CLA'], :baseId => @project.id}
- filter.metrics = [xMetric.name, yMetric.name, sizeMetric.name]
- filter.execute(self, :user => current_user)
- filter.rows.each do |row|
- x = row.measure(xMetric)
- y = row.measure(yMetric)
- size = row.measure(sizeMetric)
- %>
- {
- id: <%= row.resource.id -%>,
- key: '<%= row.resource.key -%>',
- name: '<%= row.resource.name -%>',
- longName: '<%= row.resource.long_name -%>',
+ var bubbleChartData = [
+ <%
+ filter = MeasureFilter.new
+ filter.criteria = {:qualifiers => ['FIL', 'CLA'], :baseId => @project.id}
+ filter.metrics = [xMetric.name, yMetric.name, sizeMetric.name]
+ filter.execute(self, :user => current_user)
+ filter.rows.each do |row|
+ x = row.measure(xMetric)
+ y = row.measure(yMetric)
+ size = row.measure(sizeMetric)
+ %>
+ {
+ id: <%= row.resource.id -%>,
+ key: '<%= row.resource.key -%>',
+ name: '<%= row.resource.name -%>',
+ longName: '<%= row.resource.long_name -%>',
- xMetric: <%= x ? x.value : 0 -%>,
- xMetricFormatted: <%= x ? x.value : '"-"' -%>,
+ xMetric: <%= x ? x.value : 0 -%>,
+ xMetricFormatted: <%= x ? x.value : '"-"' -%>,
- yMetric: <%= y ? y.value : 0 -%>,
- yMetricFormatted: <%= y ? y.value : '"-"' -%>,
+ yMetric: <%= y ? y.value : 0 -%>,
+ yMetricFormatted: <%= y ? y.value : '"-"' -%>,
- sizeMetric: <%= size ? size.value : 0 -%>,
- sizeMetricFormatted: <%= size ? size.value : '"-"' -%>
- },
- <% end %>
- ];
+ sizeMetric: <%= size ? size.value : 0 -%>,
+ sizeMetricFormatted: <%= size ? size.value : '"-"' -%>
+ },
+ <% end %>
+ ];
- var bubbleChartMetrics = {
- x: '<%= xMetric.short_name -%>',
- y: '<%= yMetric.short_name -%>',
- size: '<%= sizeMetric.short_name -%>'
- };
+ var bubbleChartMetrics = {
+ x: '<%= xMetric.short_name -%>',
+ y: '<%= yMetric.short_name -%>',
+ size: '<%= sizeMetric.short_name -%>'
+ };
- var bubbleChart = new SonarWidgets.BubbleChart();
- bubbleChart
- .data(bubbleChartData)
- .metrics(bubbleChartMetrics)
- .xLog(<%= xLog %>)
- .yLog(<%= yLog %>)
- .height(<%= chartHeight %>)
- .render('#<%= container_id %>');
- } else {
- document.write('<h3><%= message('widget.unsupported_browser_warning') -%></h3>');
- }
+ var bubbleChart = new SonarWidgets.BubbleChart();
+ bubbleChart
+ .data(bubbleChartData)
+ .metrics(bubbleChartMetrics)
+ .xLog(<%= xLog %>)
+ .yLog(<%= yLog %>)
+ .height(<%= chartHeight %>)
+ .render('#<%= container_id %>');
</script>
+<!--<![endif]-->
diff --git a/sonar-server/src/main/webapp/javascripts/bubble-chart.js b/sonar-server/src/main/webapp/javascripts/bubble-chart.js
index cc53294c4bf..9d903a75bac 100644
--- a/sonar-server/src/main/webapp/javascripts/bubble-chart.js
+++ b/sonar-server/src/main/webapp/javascripts/bubble-chart.js
@@ -229,7 +229,10 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets;
gxAxis.selectAll('path')
.style('fill', 'none')
- .style('stroke', '#000');
+ .style('stroke', '#444');
+
+ gxAxis.selectAll('text')
+ .style('fill', '#444');
gxAxis.append('text')
.text(this.metrics().x)
@@ -248,7 +251,10 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets;
gyAxis.selectAll('path')
.style('fill', 'none')
- .style('stroke', '#000');
+ .style('stroke', '#444');
+
+ gyAxis.selectAll('text')
+ .style('fill', '#444');
gyAxis.append('text')
.text(this.metrics().y)