在main.js中引入echarts
import echarts from 'echarts'
Vue.prototype.$echarts = echarts
在相应的vue中导入echarts
import echarts from 'echarts';
实现柱状图显示
mounted: function () {
// 基于准备好的dom,初始化echarts实例
let myChart = echarts.init(document.getElementById('echartss'))
// 绘制图表,this.echarts1_option是数据
myChart.setOption(this.echarts1_option);
}
data() {
return {
echarts1_option: {
title: {
text: '基本信息',
subtext: '虚假数据'
},
tooltip: {
trigger: 'axis'
},
color: ['rgba(31,13,230,0.95)', '#ff475d', '#49ef18', '#efeb23'],
legend: [
{
data: ['学历层次', '职业技能'],
},
{