提交 047d1831 authored 作者: 王鹏飞's avatar 王鹏飞

update

上级 78b5f90b
......@@ -91,8 +91,8 @@ export default {
option() {
return {
title: { text: '单位:万', textStyle: { fontSize: 12, color: '#0A7199' }, padding: 0 },
// tooltip: { trigger: 'axis', axisPointer: {} },
grid: { left: 0, top: '40px', right: 0, bottom: '40px', containLabel: true },
// tooltip: { trigger: 'axis', axisPointer: { type: 'none' } },
grid: { left: 'left', top: 40, right: 0, bottom: 40, containLabel: true },
legend: {
bottom: '10px',
itemWidth: 10,
......
......@@ -96,7 +96,7 @@ export default {
return {
title: { text: '单位:万', textStyle: { fontSize: 12, color: '#0A7199' }, padding: 0 },
// tooltip: { trigger: 'axis', axisPointer: { type: 'none' } },
grid: { left: 0, top: '40px', right: 0, bottom: '40px', containLabel: true },
grid: { left: 'left', top: 40, right: 0, bottom: 40, containLabel: true },
legend: {
bottom: '10px',
itemWidth: 10,
......
<template>
<v-chart class="chart" :option="option" :autoresize="true" :loading="loading" ref="chart" />
<v-chart
class="chart"
:option="option"
:autoresize="true"
:loading="loading"
@legendselectchanged="legendselectchanged"
ref="chart"
/>
</template>
<script>
......@@ -10,6 +17,7 @@ export default {
return {
loading: false,
response: [],
legendselect: {},
height: 0
}
},
......@@ -20,7 +28,9 @@ export default {
option() {
let total = 0
const data = this.response.map(item => {
if (this.legendselect[item.project_name] !== false) {
total += item.all_pay_money
}
const color = this.colors[item.project_name]
return { value: item.all_pay_money, name: item.project_name, itemStyle: { color } }
})
......@@ -83,6 +93,9 @@ export default {
this.loading = false
})
},
legendselectchanged({ selected }) {
this.legendselect = selected
},
getChartHeight() {
this.height = this.$refs.chart.$el.offsetHeight
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论