krispo / angular-nvd3

AngularJS directive for NVD3 reusable charting library (based on D3). Easily customize your charts via JSON API.
http://krispo.github.io/angular-nvd3
MIT License
1.29k stars 377 forks source link

elementClick: get series label for data-point #707

Open chrisv-dev opened 7 years ago

chrisv-dev commented 7 years ago

I would need to get the data according to a clicked/doubleClicked data-point (y-axis value, series name). I'm not sure if this is already possible but I can't find any information on this.

Using the following:

options = { type:'stackedAreaChart', useInteractiveGuideline: true, InteractiveLayer:{ dispatch:{ elementDblClick:(e)=>{ console.log(e); } } } }

When clicking a data-point on the chart the variable 'e' in the above code only gives me mouseX, mouseY and pointXValue (= 'x-value' of the data-point). It does not give me the name of the series element or the 'y-value' of the clicked point. Is there any way to achieve this?

Maybe this can be done by using the mouseX/Y coordinates to get the data point?

SamarRizvi commented 6 years ago

Any update? Anyone? I too am stuck on this.