安装:
使用:
import echarts from 'echarts'
export default {
data () {
return {
submitApprovalData: [23, 12, 12, 23, 12],
approvalPassData: [12, 23, 16, 21, 16],
totalData: []
}
},
methods: {
},
mounted () {
},
created () {
this.totalData = []
this.submitApprovalData.forEach((item, index) => {
this.totalData.push(item + this.approvalPassData[index])
})
let this_ = this
setTimeout((function () {
let chart = document.getElementById('chart_example')
let chart2 = document.getElementById('chart_example2')
let myChart = echarts.init(chart)
let myChart2 = echarts.init(chart2)
let option = {
color: ['#fff'],
backgroundColor: 'rgba(47,58,102,1)', // 背景色
xAxis : [
{
name: '任务难度', // x轴标题
type : 'category',
data : ['S', 'A', 'B', 'C', 'D'],
axisTick: {
alignWithLabel: true
},
axisLine: { //坐标线
lineStyle: {
type: 'dashed',
color: '#48558C', // 轴线的颜色
width: '1' // 坐标线的宽度
}
},
axisTick: { // 刻度
show: false // 不显示刻度线
},
nameTextStyle: { // 标题样式
color: ['#fff']
},
axisLabel: {
textStyle: {
color: '#fff', // 坐标值得具体的颜色
fontSize: 14
}
}
}
],
yAxis : [
{
name: '任务数量',
type : 'value',
axisLine: { // 线
show: false
},
axisTick: { // 刻度
show: false
},
splitLine: { // 网格为虚线
show: t