Skip to content

Commit 209dc03

Browse files
rueckstiesskangas
authored andcommitted
added glass pane on "few" charts for label hover
before, the tooltip only showed when hovering over the bar, but not the label inside the bar.
1 parent 0ca2cea commit 209dc03

File tree

1 file changed

+12
-3
lines changed
  • scout-ui/src/minicharts/d3fns

1 file changed

+12
-3
lines changed

scout-ui/src/minicharts/d3fns/few.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@ module.exports = function(data, g, width, height, options) {
6060
.attr('width', function(d) {
6161
return x(d.value);
6262
})
63-
.attr('height', barHeight)
64-
.on('mouseover', tip.show)
65-
.on('mouseout', tip.hide);
63+
.attr('height', barHeight);
6664

6765
bar.append('text')
6866
.attr('y', barHeight / 2)
@@ -74,4 +72,15 @@ module.exports = function(data, g, width, height, options) {
7472
})
7573
.attr('fill', 'white');
7674

75+
bar.append('rect')
76+
.attr('class', 'glass')
77+
.attr('y', 0)
78+
.attr('x', 0)
79+
.attr('width', function(d) {
80+
return x(d.value);
81+
})
82+
.attr('height', barHeight)
83+
.on('mouseover', tip.show)
84+
.on('mouseout', tip.hide);
85+
7786
};

0 commit comments

Comments
 (0)