Skip to content
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

Chart was not disposed - conflict with Angular/Material's BrowserAnimationsModule #3208

Closed
david-a opened this issue Jan 12, 2021 · 2 comments
Labels

Comments

@david-a
Copy link

david-a commented Jan 12, 2021

Hi,
I've noticed that when I add Angular/Material's BrowserAnimationsModule to the app's module imports, my chart (Force directed tree) is not disposed properly anymore (getting the Chart was not disposed warning) and is not rebuilt when changing to another component with the same chart in my single page app.

I'm using this.chart.dispose(); inside ngOnDestroy, which was working without the BrowserAnimationsModule. Also tried am4core.disposeAllCharts(); with no luck.

Any thoughts?

@martynasma
Copy link
Collaborator

Would you be able to post your whole chart and data on Stackblitz or Codesandbox?

@david-a
Copy link
Author

david-a commented Feb 3, 2021

Hi,
I've tried using BrowserAnimationsModule again now (was using NoopAnimationsModule until now because of this issue) and it's working. The only major thing that was changed is the way I load the amCharts library - instead of importing it statically - I've dynamically imported all amcharts related libraries, with /* webpackChunkName: "chart" */ comment. This was done in order to overcome this issue - #1146 (comment)

Thanks

@david-a david-a closed this as completed Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants