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'));

posted on 2019-04-27 13:30  果然朝辉  阅读(5742)  评论(0编辑  收藏  举报

导航