On Angular 12 webapp Google Charts component make webapp very slow also after component destruction

198 views Asked by At

I perfectly integrated Google charts in my Angular 12 webapp but the component that shows google chart make the webapp very slow on rendering graphical animation and movements. If I hide the Google chart component the webapp come back to be very fast (also the drag and drop in a different component, after google chart component has been destroyed, come back to be very fast and smooth). I tried the ngOnDestroy() {// some google destruction} method but nothing worked. What can I do?

1

There are 1 answers

0
Michele Settembre On

At the end I solved with a try: js script integration instead of angular module installation and I successfully solved the problem calling the "clearChart()" on ngOnDestroy() for any single chart created in the component. After that I warned the ng2-angular-charts module developer and the module has been updated (problem solved).