Like mousehover does, when the mouse goes hover the element (bar), it gets highlighted and drops that highlight when mouse leaves.
I'm wondering how to use that behavior but for a click event: highlight the bar when click.
Like mousehover does, when the mouse goes hover the element (bar), it gets highlighted and drops that highlight when mouse leaves.
I'm wondering how to use that behavior but for a click event: highlight the bar when click.
You can always bind event listeners with d3. You select the element and you bind the event. In your concrete element, check the class of the bars and bind it.
Something like this:
d3.selectAll(".nv-bar").on('click',
function(){
// add the effects or the class that enlarge the bar
});
reference: How to add a click event on nvd3.js graph