先查有数据的日期,再查没数据的日期,饼图数据没清空
This commit is contained in:
parent
471666911f
commit
207c316d53
|
@ -41,6 +41,7 @@ export default {
|
||||||
pieData: [],
|
pieData: [],
|
||||||
pieColors: ['#00bcd4', '#14b2a3', '#97b94b', '#47b55d'],
|
pieColors: ['#00bcd4', '#14b2a3', '#97b94b', '#47b55d'],
|
||||||
pieTotal: 0,
|
pieTotal: 0,
|
||||||
|
sourceChart: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -113,6 +114,8 @@ export default {
|
||||||
this.pieData = res.result.pieData
|
this.pieData = res.result.pieData
|
||||||
this.pieTotal = res.result.pieTotal
|
this.pieTotal = res.result.pieTotal
|
||||||
this.drawRightChart()
|
this.drawRightChart()
|
||||||
|
} else {
|
||||||
|
this.sourceChart.clear()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning('This operation fails. Contact your system administrator')
|
this.$message.warning('This operation fails. Contact your system administrator')
|
||||||
|
@ -247,7 +250,7 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
drawRightChart() {
|
drawRightChart() {
|
||||||
let myChart = echarts.init(document.getElementById('chartRight'))
|
this.sourceChart = echarts.init(document.getElementById('chartRight'))
|
||||||
let options = {
|
let options = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'item',
|
trigger: 'item',
|
||||||
|
@ -308,9 +311,9 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
myChart.setOption(options)
|
this.sourceChart.setOption(options)
|
||||||
window.addEventListener('resize', function () {
|
window.addEventListener('resize', function () {
|
||||||
myChart.resize()
|
this.sourceChart.resize()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user