You must be logged in to post your query.
Home › Forums › Chart Support › A proper way to destroy charts
I’m using Angular 14
What is the proper way to dispose (destroy) charts when user navigates between pages? When it happens quite quick there are possible errors like:
– ERROR TypeError: Cannot read properties of undefined (reading ‘style’)
at n._updateOptions (canvasjs.min.js:170:13)
at n._initialize (canvasjs.min.js:172:356)
at n.render (canvasjs.min.js:205:264)
– ERROR TypeError: Cannot set properties of undefined (setting ‘container’)
at n.destroy (canvasjs.min.js:157:273)
– Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true.
I called destroy() function on all charts in OnDestroy, but it still produce randomly those errors
As for the last I saw an info in documentation but it doesn’t helped me
It seems to be working fine. Can you kindly create a sample project reproducing the issue you are facing and share it with us over Google Drive or OneDrive so that we can look into your code, run it locally at our end to understand the scenario better, and help you out?
You must be logged in to reply to this topic. Login/Register