I am clearing am chart as per requirement and after it get cleared ,unable to create it again.it throws as error
`
refreshButtonClickEvent() {
this.priceChart.clear();
}
plotGraph() {
if(!this.priceChart) {
console.log("new graph");
console.log( this.priceChart);
this.graphconfig.dataSets[0].dataProvider=data;
let ele=document.getElementById("chartdiv");
this.priceChart=this.AmCharts.makeChart(ele,this.graphconfig);
}
else {
this.AmCharts.updateChart(this.priceChart, () => {
I am clearing am chart as per requirement and after it get cleared ,unable to create it again.it throws as error ` refreshButtonClickEvent() { this.priceChart.clear(); } plotGraph() { if(!this.priceChart) {
console.log("new graph");
console.log( this.priceChart); this.graphconfig.dataSets[0].dataProvider=data; let ele=document.getElementById("chartdiv"); this.priceChart=this.AmCharts.makeChart(ele,this.graphconfig); } else { this.AmCharts.updateChart(this.priceChart, () => {
}
} when i reinitialized am chart following error comes
`