Article From:https://segmentfault.com/q/1010000012895108
Question:

1、In Vue, use echarts and Baidu map to draw a map on a thermal map, click the button to provide a data, change the thermal map, but don’t know why setOption that sentence is performed for a very long time, about two or three seconds; it is not ill when written in pure JS. PoiNts is about 60 of the length.
2、Code:

changeChart(index){
      let points=this.$store.state.optionData; 
      var newOp=this.myChart.getOption();
      newOp.series[0].data=points;
      this.myChart.setOption(newOp);//This sentence has been carried out for a long time and does not know why 0}

3、This is the appearance of the result

Answer 0:

Try
this.$nextTick(function(){

this.myChart.setOption(newOp);

});

Leave a Reply

Your email address will not be published. Required fields are marked *