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'));
原文地址:https://www.cnblogs.com/phonecom/p/10778454.html