angular-highcharts
angular-highcharts copied to clipboard
TypeError: Cannot read property 'forExport' of undefined
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?