Skip to content

Commit 40d5b96

Browse files
author
Tom Bevers
committed
Add tooltip to the coverage graphs
1 parent 6638a3b commit 40d5b96

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

PHP/CodeCoverage/Report/HTML/Renderer/Template/dashboard.html.dist

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ $(document).ready(function() {
209209
.showLegend(false)
210210
.forceX([0, 100]);
211211
chart.scatter.onlyCircles(false);
212+
chart.tooltipContent(function(key, y, e, graph) {
213+
return '<p>' + graph.point.class + '</p>';
214+
});
212215

213216
chart.xAxis.axisLabel('Code Coverage (in percent)');
214217
chart.yAxis.axisLabel('Cyclomatic Complexity');
@@ -231,6 +234,9 @@ $(document).ready(function() {
231234
.showLegend(false)
232235
.forceX([0, 100]);
233236
chart.scatter.onlyCircles(false);
237+
chart.tooltipContent(function(key, y, e, graph) {
238+
return '<p>' + graph.point.class + '</p>';
239+
});
234240

235241
chart.xAxis.axisLabel('Code Coverage (in percent)');
236242
chart.yAxis.axisLabel('Method Complexity');
@@ -253,6 +259,7 @@ $(document).ready(function() {
253259
values.push({
254260
x: value,
255261
y: data[key][1],
262+
class: data[key][2],
256263
size: 0.05,
257264
shape: 'diamond'
258265
});

0 commit comments

Comments
 (0)