目录代码整合

This commit is contained in:
aixianling
2022-05-10 20:02:37 +08:00
parent 71049f7f65
commit 036ee91533
324 changed files with 4 additions and 8321 deletions

View File

@@ -0,0 +1,78 @@
<template>
<div style="width:100%;height: 160px;"/>
</template>
<script>
import * as echarts from "echarts";
export default {
props: {
chartData: {
type: Array,
required: true
},
colorList: {
type: Array,
}
},
data() {
return {
chart: null,
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
methods: {
initChart() {
this.chart = echarts.init(this.$el)
this.setOptions(this.chartData)
},
setOptions() {
this.chart.setOption({
tooltip: {
trigger: 'item',
formatter: '<br/>{b} : {c} ({d}%)'
},
series: [{
type: 'pie',
radius: ['40%', '90%'],
color: this.colorList,
avoidLabelOverlap: false,
label: {
show: true,
position: 'inside',
formatter: '{d}%',
fontSize: '12',
},
emphasis: {
label: {
show: true,
fontSize: '12',
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: this.chartData
}]
})
}
},
watch: {
chartData: {
deep: true,
handler(val) {
this.setOptions(val)
}
}
},
}
</script>
<style lang="scss" scoped>
</style>