I have a simple pie chart . When you click on a pie wedge, a tooltip for that wedge appears.
I am trying to implement the same functionality, but on the outside div elements of a pie chart.
Scenario:
A user who focuses on the "Cat 1" div and shows hits displays a tip for the Cat 1 wedge
A user who focuses on the Cat 2 div and shows hits displays a tip for the Cat 2 wedge
A user who focuses on the Cat 3 div and shows hits displays a tip for the Cat 3 wedge
I tried something like:
function ShowTooltip() {
d3.selectAll('.nvtooltip').each(function(){
this.style.setProperty('display', 'block', 'important');
});
};
plunkr, . ?
$(document).keydown(function(event) {
if (event.keyCode === 13 && $('.cat-count').is(':focus')) {
console.log('do something');
ShowTooltip();
}
});