amcharts / amstock3

JavaScript Stock Chart V3
Other
53 stars 31 forks source link

Unable to create new AM CHART instance once it clear #11

Open pankajd1990 opened 5 years ago

pankajd1990 commented 5 years ago

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, () => {

      this.priceChart.dataSets[0].dataProvider= this.priceChart.dataSets[0].dataProvider.concat(data);
      this.priceChart.ignoreZoom = true;
      this.priceChart.validateData();             
     console.log("update graph");

    });

}

} when i reinitialized am chart following error comes refresh_issue

`

pankajd1990 commented 5 years ago

Waiting for reply