判断echart是否已经存在,如果不存在,就进行初始化


判断echart是否已经存在,如果不存在,就进行初始化

There is a chart instance already initialized on the dom

 

 

//获取已有echarts实例的DOM节点。
let myChart = echarts.getInstanceByDom(document.getElementById("fei"));
if (myChart == null) { // 如果不存在,就进行初始化。
  myChart = echarts.init(document.getElementById("fei"));
  myChart.setOption(options, true);
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM