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

on Zoom reset callback #27

Open
geekorlife opened this issue Nov 6, 2019 · 1 comment
Open

on Zoom reset callback #27

geekorlife opened this issue Nov 6, 2019 · 1 comment

Comments

@geekorlife
Copy link

Hi !
Thanks for this useful plugins !
I have the need to know when we click on the "Reset zoom" button but I don't see the possibility to pass a callback.
I maybe wrong, so let me know.

@njoyard
Copy link

njoyard commented Apr 6, 2020

Workaround I'm using:

callbacks: {
  afterZoom() {
    let button = document.querySelector('.reset-zoom')
    if (!button.hasResetHandler) {
      button.hasResetHandler = true
      button.addEventListener('click', () => {
        // whatever
      })
    }
  }
}

danmana added a commit to danmana/chartjs-plugin-crosshair that referenced this issue Sep 21, 2020
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