echarts 重新渲染数据
调用时// vue 函数中let chartDom = document.getElementById("myChart2")if (chartDom.hasAttribute("_echarts_instance_")) {chartDom.removeAttribute("_echarts_instance_");}this.myChartLed = this.$echarts.init(ch
·
调用时,要在页面dom渲染完毕后(可以通过this.$nextTick(()) => {}进行确认),再进行渲染echarts
// vue 函数中
let chartDom = document.getElementById("myChart2")
if (chartDom.hasAttribute("_echarts_instance_")) {
chartDom.removeAttribute("_echarts_instance_");
}
this.myChartLed = this.$echarts.init(chartDom);
let option = {
...
};
this.myChartLed.clear();
this.myChartLed.setOption(option);
亲测有效
更多推荐
已为社区贡献3条内容
所有评论(0)