if (!window.console || !console.firebug){
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
window.console = {};
for (var i = 0; i < names.length; ++i)
window.console[names[i]] = function() {}
}
是因为echart中的canvas重新加载了 ,详情参考 https://www.jb51.net/article/128795.htm
直接给echart赋值就可以。自适应
chart = document.getElementById("staChart");
chart.style.width = $(window).width()*0.45+‘px‘;
chart.style.height = $(window).height()*0.3+‘px‘;
var myChart = echarts.init(chart);
myChart.setOption(getChartOption());
原文:https://www.cnblogs.com/li19950227/p/11990499.html