<template>
<div>
<div>
<!--为echarts准备一个具备大小的容器dom-->
<div id="org_ech_line"></div>
</div>
</div>
</template>
<script>
import * as echarts from 'echarts'
export default {
data() {
return {
is_condolences: 0,
isAll: 0,
is_active: 0,
opinionData: ['3', '2', '4', '4', '5'],
incomeLineData: ['3', '2', '4', '4', '5']
}
},
methods: {
orgLine(id) {
const charts = echarts.init(document.getElementById(id))
charts.setOption({
tooltip: {
trigger: 'axis',
showContent: true,
formatter: '组织数量: {c0}'
},
grid: {
left: '3%',
top: '10%',
right: '4%',
bottom: '10%',
containLabel: true,
show: false
},
xAxis: {
type: 'category',
data: ['2017', '2018', '2019', '2020', '2021'],
axisLabel: {
color: '#6e7379',
fontSize: 12
},
axisTick: {
show: false
},
axisLine: {
lineStyle: {
}
}
},
yAxis: {
type: 'value',
axisTick: {
show: false
},
axisLine: {
lineStyle: {
}
},
axisLabel: {
show: true,
color: '#6e7379',
fontSize: 12
}
},
series: [{
name: '组织数量',
type: 'line',
data: this.opinionData,
itemStyle: {
normal: {
color: '#51BAE4'
}
}
}]
})
}
},
mounted() {
this.$nextTick(function() {
this.orgLine('org_ech_line')
})
}
}
</script>
<style>
#org_ech_line{
width: 500px;
height: 500px;
}
</style>
|