ECharts使用:this.dom.getContext is not a function
echarts 画图报错 this.dom.getContext is not a function;
原因:因为在初始化echarts的时候,echarts.js规定只能使用dom原生方法获取标签,即document.getElementById('main');
错误写法:
var myCommentLineChart = echarts.init($("#comment-line"));
正确写法:
var myCommentLineChart = echarts.init(document.getElementById('comment-line'));
只言片语任我说,提笔句句无需忖。落笔不知寄何人,唯有邀友共斟酌。