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