使用echarts防止出现“There is a chart instance already initialized on the dom.”的警告

来源:互联网 发布:程序员转行产品经理 编辑:程序博客网 时间:2024/06/05 09:36
var myChart;function historyMapInit(query_date) {    //防止出现“There is a chart instance already initialized on the dom.”的警告    //在使用echarts发现需要及时对新建的myChart实例进行销毁,否则会出现上述警告    console.log(myChart != null && myChart != "" && myChart != undefined);    if (myChart != null && myChart != "" && myChart != undefined) {        myChart.dispose();    }
myChart = echarts.init(document.getElementById('result_monthtotle_maps_id'));
}
阅读全文
0 0
原创粉丝点击