Could someone assist me in capturing the click event on a nvd3 stacked area chart? I have successfully managed to capture tooltip show and hide events but am struggling with the click event. How can I obtain information about the clicked point? Please help. Here is the link to the Plunker.
This is my chart configuration:
chart: {
type: 'stackedAreaChart',
height: 450,
x: function (d) { return d[0]; },
y: function (d) { return d[1]; },
showValues: true,
valueFormat: function (d) { return d3.format(',.4f')(d); },
dispatch: {
tooltipShow: function (e) { console.log('! tooltip SHOW !') },
tooltipHide: function (e) { console.log('! tooltip HIDE !') },
beforeUpdate: function (e) { console.log('! before UPDATE !') },
elementClick: function (e) { alert('clicked');}
}
}
};