后台项目中有一个需求需要图表,最后在v-charts和echarts中选择了echarts,因为刚接处,api还没有看完, 不知道是否可以指定对应字段的方法,所以先提一个方法过度,如有更好方案,请指教。 <div id="myChart" :style="{width: '400px', height: '400px'}"></div>
mounted(){ this.drawLine(); },
methods:{
drawLine(){ console.log(1112) // 基于准备好的dom,初始化echarts实例 var myChart = this.$echarts.init(document.getElementById('myChart')); // 绘制图表 var option = { title : { text: '学历分布', x:'center', top:'20px', subtext:'', }, tooltip : { trigger: 'item', formatter: "{a} <br/>{b} : {c} ({d}%)" }, legend: { orient: 'vertical', left: 'center', bottom:'bottom', dat