-
Notifications
You must be signed in to change notification settings - Fork 328
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
Setting up Zoom with react-chartjs-2 #64
Comments
Solved: I don't know if this is the proper way to do this, but I just imported the plugin in my chart component file:
and the pan and zoom options started working. If there is no better approach, I think the issue can be closed! :) |
Hi, i'm a newbie with js and i'm trying to use the zoom and pan functions in one graph, but only zoom works, can you show me your code or tell me how do i import it like you did ? ps: i don't speak very well English |
Does anyone know do I implement an onClick button to reset the zoom back to default? |
@junbinku I think you are looking for this. |
@miguelperes can you tell me how did you configured hammerjs? |
@kashifsulaiman import Hammer from 'hammerjs'; |
it has been a few years but if someone else want to do a reset button when using react (like @junbinku was asking) : in your render you need to get the component reference, for example with a
|
or if you're using hooks
|
@dopry I had to use |
What is the proper way to setup zoom plugin with react-chartjs-2? Is it compatible?
I just ran
npm install chartjs-plugin-zoom
which installed the plugin and itshammerjs
dependency and started configuring my chart options:However this is not working. Am I skipping any step? I searched for react-chartjs-2 specific issues but found nothing. Thanks!
The text was updated successfully, but these errors were encountered: