1、There is a chart instance already initialized on the dom.
解决办法:重绘图表时,我们要把之前已经渲染好的图表清空。
const getEcharts = () => {
let myChart = echarts.getInstanceByDom(
document.getElementById("chart")
);
if (myChart == null) {
myChart = echarts.init(document.getElementById("chart"));
}
myChart.setOption(option);
}