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

How to make an action on the graph click? #925

Open
igorpronin opened this issue Oct 28, 2019 · 1 comment
Open

How to make an action on the graph click? #925

igorpronin opened this issue Oct 28, 2019 · 1 comment

Comments

@igorpronin
Copy link

I need to get data from the point of the graph on click on it, then make an action with it. Please, help to find the right way to do it. Is it possible in MetricsGraphics.js?

Thanks.

jens-ox added a commit to jens-ox/metrics-graphics that referenced this issue Mar 11, 2020
@jens-ox
Copy link
Member

jens-ox commented Mar 11, 2020

This is implemented in the updated fork over at https://github.com/jens-ox/metrics-graphics, but isn't documented yet. You can pass a voronoi parameter when instantiating a LineChart, which allows overriding the default voronoi behavior:

new LineChart({
  //...
  voronoi: {
    onClick: point => {
      // do something
    }
  }
})

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

2 participants