Closed turu-shep closed 5 years ago
@kaname52 I tried to replicate this with the updated version , using a simple ngIf hook, couldn't able to replicate. Can you please tell which version of angular-fusioncharts you are using
@ashok1994 2.0.2 along with licensed fusioncharts v.3.13.1-sr.1
I tried this version too, could not replicate the problem, if you can provide me with small scaled version of the example replicating the problem it'll be great @kaname52
I'm getting the same issue. Angular 7.
While chart component is initializing, quickly switch to a view that hides the chart and you get it everytime.
In my specific instance, I have buttons that change each view based on an ngSwitch.
This happens at fusioncharts.component.js.364 - the chart is undefined if you try to switch too quickly, as if it was never initialized - so adding a check to make sure there is a chart before trying to destroy it does the trick.
if(this.chartObj !== undefined){ this.chartObj.dispose(); }
Assuming there is likely a more elegant way to handle it, but this works for me for now.
@ashok1994, hi, I created a private demo repo to reproduce this error, https://github.com/vherever/fusioncharts-demo Thank you in advance!
@vherever please add me to your private repo. I'll investigate your issue.
@rohanoid5 added you too, thank you
@vherever this issue has been fixed. Please update angular-fusioncharts
@rohanoid5 thank you! I believe this PR can be closed now https://github.com/fusioncharts/angular-fusioncharts/pull/57 since it fixes the same issue
@rohanoid5 Thank you, it works!
We use many charts in app and user can switch from one chart type to another (rendered as different components of course). Also charts are rebuilded on window:resize event. If few resize event appear in a row or user switches fast from one chart to another, his console becomes filled with this messages:
that comes from angular-fusioncharts component, ngOnDestroy hook. Sometimes this blocks chart rendering, sometimes not (10% of cases - blocks and nothing is rendered). I believe it's trying to dispose chart config object, but if chart was not fully initialized by the time it gets destroyed, there won't be this object, so nothing to dispose.