Replies: 6 comments
-
You can use the |
Beta Was this translation helpful? Give feedback.
-
@LeeLenaleee thank you, but it gives me weird numbers: ZOOM START 3.15 What do they mean, why the are not like, you know, once selected zoom level = 1, selected on selected (twice) zoom level = 2 and so on etc. It'll be very plain to see and handle. And I also want to have my own state variable to show a zoom out button only when user zoomed at least once, so I still want to set and have an access to zoom state variable inside the onZoomStart function. Currently it could not read updated values, I wonder why?
here it always says zoomLevel = 0 |
Beta Was this translation helpful? Give feedback.
-
Those are the real zoom values, so that a zoomLevel of 8 is always consistent and the same, in your solution if someone zooms 7 times by selecting almost the whole chartArea they can't zoom any further while someone else that selects 2 pixels can zoom 6 more times. |
Beta Was this translation helpful? Give feedback.
-
@LeeLenaleee, @vtarelkin How to get boundaries(here boundaries as in min and max value for x and y for particular zoom) onZoom? |
Beta Was this translation helpful? Give feedback.
-
If im correct you get the chart object in your onZoom callback, here you can call |
Beta Was this translation helpful? Give feedback.
-
It worked thank you : ) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to programatically close zoom ability
I have a variable
const [zoomLevel, setZoomLevel] = useState(0);
Use it like this
And zoom stops working almost immediately. What am I doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions