解决echarts报There is a chart instance already initialized on the dom.错误


当echarts实例存在时,从柱状图切换到饼图或其他一些图时,会出错。
所以要先销毁这个实例
然后再重新创建

 echarts.init(document.getElementById("echartsTest5")).dispose();//解决echarts dom已经加载的报错
 myChart = echarts.init(document.getElementById("echartsTest5"));

直接使用mycharts.dispose()无效


免责声明!

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



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