监听magictypechanged
this.myChart.on('magictypechanged', params => { if(params.currentType==='line'){ for(let i in params.newOption.series){ params.newOption.series[i].stack=null
} this.myChart.setOption(params.newOption)
} if(params.currentType==='bar'){ for(let i in params.newOption.series){ params.newOption.series[i].stack=1
} this.myChart.setOption(params.newOption)
}
});