angular-highcharts icon indicating copy to clipboard operation
angular-highcharts copied to clipboard

TypeError: Cannot read property 'forExport' of undefined

Open RiccardoCampese opened this issue 4 years ago • 0 comments

Hi, I have a problem with this piece of code right here. HighchartsChartComponent.prototype.ngOnDestroy = /** * @return {?} */ function () { // #44 if (this.chart) { // #56 // #56 this.chart.destroy(); this.chart = null; } }; Basically, when the onDestroy is called in my Angular component, this.chart.destroy(); throws an error: TypeError: Cannot read property 'forExport' of undefined at c.Chart.destroy (highcharts.js:305) at HighchartsChartComponent.push.../../node_modules/highcharts-angular/fesm5/highcharts-angular.js.HighchartsChartComponent.ngOnDestroy (highcharts-angular.js:86)

Any idea on how to solve this problem? How can I make it not trigger that destroy method for my chart?

RiccardoCampese avatar Mar 10 '20 13:03 RiccardoCampese