You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the Nivo chart library in one of my projects and I've found it to be very useful. However, I've encountered a situation where I need to get the exact data point that a user clicks on in a chart.
Currently, when a user clicks on a point, the onClick event returns an array of all data points. While this is helpful for many use cases, in my situation, I need to know the specific point that was clicked.
For example, in a bump chart, when I click on a data point and log the returned value using onClick, I get:
It returned the values of this data point for all x-axes (2007 - end), but I have clicked on the data point in the 2010 column, and I want a way to know which exact data point is clicked (so I can filter the data and display a monthly chart for that specific year).
I was wondering if it might be possible to add this functionality or if is there already a way to achieve this.
The text was updated successfully, but these errors were encountered:
Hey @saeedesmaili Bump chart specifically does not have this functionality. You could add a "Mesh" layer to achieve this. I created this PR to address the issue, but haven't received any comments so far.
In the meantime you could use the code there in your own codebase.
I'm using the Nivo chart library in one of my projects and I've found it to be very useful. However, I've encountered a situation where I need to get the exact data point that a user clicks on in a chart.
Currently, when a user clicks on a point, the onClick event returns an array of all data points. While this is helpful for many use cases, in my situation, I need to know the specific point that was clicked.
For example, in a bump chart, when I click on a data point and log the returned value using onClick, I get:
It returned the values of this data point for all x-axes (2007 - end), but I have clicked on the data point in the 2010 column, and I want a way to know which exact data point is clicked (so I can filter the data and display a monthly chart for that specific year).
I was wondering if it might be possible to add this functionality or if is there already a way to achieve this.
The text was updated successfully, but these errors were encountered: