Hover events can be enabled on bar charts using
bar.hover()
.
If a truthy value is passed, hovering the mouse over a bar will cause the bar to become a darker color. If
a function is passed, in addition to the bar becoming a darker color the function will be called just as in
selection.on()
and as described in the API documentation.
This example shows how to respond to these events by placing the percentage value above a bar when it is hovered.