1、There is a chart instance already initialized on the dom.
文章来源:https://www.toymoban.com/news/detail-735595.html
解决办法:重绘图表时,我们要把之前已经渲染好的图表清空。文章来源地址https://www.toymoban.com/news/detail-735595.html
const getEcharts = () => {
let myChart = echarts.getInstanceByDom(
document.getElementById("chart")
);
if (myChart == null) {
myChart = echarts.init(document.getElementById("chart"));
}
myChart.setOption(option);
}
到了这里,关于【Echarts】 报错There is a chart instance already initialized on the dom.的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!