zoom and annotation don't work together
See original GitHub issueWell, I’ll try to ask here, trying to use both plugins
const options = useMemo(() => ({
plugins: {
zoom: zoomOptions,
annotation: annotationOptions,
legend: {
display: false
},
tooltip: {
enabled: false
},
},
responsive: true,
maintainAspectRatio: false,
scales: scales,
elements: {
point: {
radius: 0,
hoverRadius: 0,
borderWidth: 0,
backgroundColor: 'rgba(0,0,0,0)'
}
}
}), [zoomOptions, annotationOptions, preparedSpectraData]);
But when I set custom zoom in my chart and change annotation options by, for ex. pressing the button that adds a line on my chart, then zoom is resetting because whole chart is updating. Maybe you have some thoughts on this how can I avoid this behavior?
Issue Analytics
- State:
- Created a year ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Enabling or disabling annotation tools for meetings
Sign in to the Zoom web portal · In the navigation panel, click Account Management then Account Settings. · Click the Meeting tab....
Read more >Annotation not working consistently after I did the recent update
Hello,. I did the update recommended last evening and when I was in a Zoom Meeting tutoring a student, my writing tool would...
Read more >Zoom Screen Sharing and Annotation - CTE Resources
This allows you to look at a program or document together, and to share PowerPoint slides with your class as you lecture via...
Read more >Guide to Zoom: Annotation Tools
Mouse: Deactivate annotation tools and switch to your mouse pointer. · Select (only available if you started the shared screen or whiteboard): Select,...
Read more >Use annotation while sharing your screen in Teams
Annotation—powered by Microsoft Whiteboard—helps you collaborate on things like a design or presentation while sharing your screen in a Teams meeting.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
not totally sure where the issue lies, within the plugin or withing the wrapper.
It seems that it is not an issue with the annotation plugin, if you make a state for the labels array zoom and change the labels array to somthing else it also happens.
Although I am suspecting the issue to be in the wrapper since if you go into the chart object and add the annotion that way and update it, it works fine: https://stackblitz.com/edit/react-ts-7g5czk?file=Chart.js
@kurkle can you switch this issue over to the zoom repo?
I’m not sure the issue is in the zoom plugin either. The chart is re-created due to state change, so the issue is actually the usage of state for the annotation options. I’m sure there are use cases where its better to re-create the chart when options change, but this is not one of those.
Similar to @LeeLenaleee workaround, but updating the original object (reference) instead. https://stackblitz.com/edit/react-ts-7fmejn