-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Cannot read property 'parentNode' of null #3930
Comments
@The8Monkey any reason you are destroying the charts and creating them again instead of just changing the chart data and calling |
When i use |
Rather than opening a new I thought I'd jump onto this one. I'm getting I'm using update in other places, but I do often remove the charts from the screen (which does require use of .destroy()). Any ideas? |
Well, this also happens when using Chart.js in Ionic (mobile apps) using ng2-charts (https://github.com/valor-software/ng2-charts) since Ionic automatically destroys the view on hide/page switch etc... (e.g. a SegmentButton using ngSwitch will destory the DOM node a chart refers to when the user switches A/B) Edit: In my specific case I was able to fix it by using "display: none" instead of destroying. But it would be awesome if you could just add the missing |
Might have been fixed by #4591: you can try the latest development build to confirm. Though, the chart JavaScript instance keeps a reference on the canvas, so even if the node is removed from the DOM, I doubt it will be GC'ed until you also destroy the chart object as well ( |
Hello, Indeed with the version 2.7 as suggested by @simonbrunel and since I'm using it, I did not still encountered the message error (in subject) until now... Thanks again ! |
How can i update the chart without pushing the data again? |
Hello,
i using the following js to create 2 bar charts and destroy and rebuild them when in change a a value via dropdown menu.
when i call my updateCharts i get the error
The charts a working fine so far but i still get the error.
At some point he was not able to resize the first chart(dia1).
Dose anyone know a solution for this?
Regards Monkey
The text was updated successfully, but these errors were encountered: