Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an onClick prop for Line chart component #485

Open
ToyWalrus opened this issue Dec 19, 2024 · 1 comment
Open

Provide an onClick prop for Line chart component #485

ToyWalrus opened this issue Dec 19, 2024 · 1 comment

Comments

@ToyWalrus
Copy link

ToyWalrus commented Dec 19, 2024

Provide a general summary of the feature here

The onClick prop has been added to the Bar chart component, but it'd be helpful to have it for Line as well.

🤔 Expected Behavior?

Hovering over the line chart when there's a ChartTooltip child component shows a tooltip line and a circle indicating the closest line point. When hovering over that circle (or maybe anywhere when the pointer is hovering over the chart, taking the closest point) clicking the line chart should fire a callback with the datum of the point provided as the argument.

💁 Possible Solution

No response

🔦 Context

For the ActivityMap Chrome extension we are updating, we want to use RSC. But we need the ability to have an onClick callback to the live chart view, so that we can focus all of the data in a separate panel that happens at the point in time which the user clicked on.

💻 Examples

This would work similarly to how the Bar's onClick works.

<Line {...lineProps} onClick={(datum) => console.log(datum)} />

🧢 Your Company/Team

ClientApps

@ToyWalrus
Copy link
Author

Reference to the issue for adding onClick to Bar: #397

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant