您的位置:首页 > Web前端 > AngularJS

angularjs重新执行echarts时出现 there is a chart instance already initialized on the dom解决

2018-03-17 15:44 405 查看
ab09
there is a chart instance already initialized on the dom

在DOM上已经初始化了一个图表实例

解决方案:

var myChart;
//防止出现“There is a chart instance already initialized on the dom.”的警告
//在使用echarts发现需要及时对新建的myChart实例进行销毁,否则会出现上述警告
if(myChart != null && myChart != "" && myChart != undefined) {
myChart.dispose();
}
myChart = echarts.init(document.getElementById('myId'));
var option1={...}
myChart.setOption(option1)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐