KPI快速切换页面报错,饼图颜色

This commit is contained in:
猫猫guowen
2025-12-16 13:41:58 +08:00
parent 7eb3c01684
commit bbe7b8a021
3 changed files with 13 additions and 0 deletions

View File

@@ -116,6 +116,9 @@ export default {
},
/** 更新图表数据 */
updateChart() {
// 在调用setOption前检查chart实例是否存在
if (this.chart && typeof this.chart.setOption === 'function') {
const option = {
title: {
text: '入库数量统计' // 入库数量统计(按巷道)
@@ -166,6 +169,10 @@ export default {
}))
}
this.chart.setOption(option, true)
} else {
console.warn('Chart instance is not ready yet');
}
},
/** 处理日期范围变化 */
handleDateRangeChange(val) {

View File

@@ -116,6 +116,8 @@ export default {
},
/** 更新图表数据 */
updateChart() {
// 在调用setOption前检查chart实例是否存在
if (this.chart && typeof this.chart.setOption === 'function') {
const option = {
title: {
text: '出库数量统计' // 出库数量统计(按巷道)
@@ -163,6 +165,9 @@ export default {
}))
}
this.chart.setOption(option, true)
} else {
console.warn('Chart instance is not ready yet');
}
},
/** 处理日期范围变化 */
handleDateRangeChange(val) {

View File

@@ -192,6 +192,7 @@ export default {
color: "#292c2c"
},
},
color: ['#25abd9', '#fac858', '#91cc75', '#ee6666', '#73c0de', '#3ba272'], // 添加六个自定义颜色
series: [{
name: '货位状态',
type: 'pie',