最近在将一个echarts2.2.7的版本修改兼容到ie8,其中遇到一个坑echarts2.2.7的demo在IE8下显示正常,并且我们项目里面的首页饼状图pie,和柱状图都能正常显示,但是子页面的饼状图和柱状图显示不出来,并且报错参数无效,因为IE8下无法进行调试,只能用Echarts的源代码加进去进行调试。定位到了vmlcanvas代码处的错误:
var Painter = function (root, storage) {
this.root = root;
root.style['-webkit-tap-highlight-color'] = 'transparent';
root.style['-webkit-user-select'] = 'none';
root.style['user-select'] = 'none';
root.style['-webkit-touch-callout'] = 'none';
this.storage = storage;
root.innerHTML = '';
this._width = this._getWidth();
this._height = this._getHeight();
var domRoot = document.createElement('div');