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

Trigger onElementClick when clicking anywhere on line/area charts #828

Open
2 tasks done
Zacqary opened this issue Sep 17, 2020 · 1 comment
Open
2 tasks done

Trigger onElementClick when clicking anywhere on line/area charts #828

Zacqary opened this issue Sep 17, 2020 · 1 comment
Labels
enhancement New feature or request :interactions Interactions related issue :xy Bar/Line/Area chart related

Comments

@Zacqary
Copy link

Zacqary commented Sep 17, 2020

Is your feature request related to a problem? Please describe.
I'm trying to build an area chart which allows the user to jump to a point in time when they click on it. Using onElementClick, this works when I click exactly on a point:

Screen Shot 2020-09-17 at 3 20 43 PM

But when I click slightly next to a point, it doesn't work, even though there's still a tooltip present:

Screen Shot 2020-09-17 at 3 20 51 PM

Describe the solution you'd like
I'd like to be able to trigger onElementClick if I click anywhere on the chart. If I'm not clicking exactly on a point, I'd like to trigger the onElementClick corresponding to whichever point is being displayed in the tooltip.

This behavior could be enabled by a prop, e.g.:

<Settings onElementClick={onClick} interactWithNearestElement={true} />

Kibana Cross Issues
Not exactly a cross-issue, but this would be very useful for elastic/kibana#73962

Checklist

  • this request is checked against already exist requests
  • every related Kibana issue is listed under Kibana Cross Issues list
@dgieselaar
Copy link
Member

The @elastic/profiling-ui team also needs this (clicking on an area, not just the point itself should trigger onElementClick), to be able to switch to a stacked area chart for the desired look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request :interactions Interactions related issue :xy Bar/Line/Area chart related
Projects
None yet
Development

No branches or pull requests

3 participants