KPI快速切换页面报错,饼图颜色
This commit is contained in:
@@ -116,6 +116,9 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 更新图表数据 */
|
/** 更新图表数据 */
|
||||||
updateChart() {
|
updateChart() {
|
||||||
|
// 在调用setOption前检查chart实例是否存在
|
||||||
|
if (this.chart && typeof this.chart.setOption === 'function') {
|
||||||
|
|
||||||
const option = {
|
const option = {
|
||||||
title: {
|
title: {
|
||||||
text: '入库数量统计' // 入库数量统计(按巷道)
|
text: '入库数量统计' // 入库数量统计(按巷道)
|
||||||
@@ -166,6 +169,10 @@ export default {
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
this.chart.setOption(option, true)
|
this.chart.setOption(option, true)
|
||||||
|
} else {
|
||||||
|
console.warn('Chart instance is not ready yet');
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
/** 处理日期范围变化 */
|
/** 处理日期范围变化 */
|
||||||
handleDateRangeChange(val) {
|
handleDateRangeChange(val) {
|
||||||
|
|||||||
@@ -116,6 +116,8 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 更新图表数据 */
|
/** 更新图表数据 */
|
||||||
updateChart() {
|
updateChart() {
|
||||||
|
// 在调用setOption前检查chart实例是否存在
|
||||||
|
if (this.chart && typeof this.chart.setOption === 'function') {
|
||||||
const option = {
|
const option = {
|
||||||
title: {
|
title: {
|
||||||
text: '出库数量统计' // 出库数量统计(按巷道)
|
text: '出库数量统计' // 出库数量统计(按巷道)
|
||||||
@@ -163,6 +165,9 @@ export default {
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
this.chart.setOption(option, true)
|
this.chart.setOption(option, true)
|
||||||
|
} else {
|
||||||
|
console.warn('Chart instance is not ready yet');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
/** 处理日期范围变化 */
|
/** 处理日期范围变化 */
|
||||||
handleDateRangeChange(val) {
|
handleDateRangeChange(val) {
|
||||||
|
|||||||
@@ -192,6 +192,7 @@ export default {
|
|||||||
color: "#292c2c"
|
color: "#292c2c"
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
color: ['#25abd9', '#fac858', '#91cc75', '#ee6666', '#73c0de', '#3ba272'], // 添加六个自定义颜色
|
||||||
series: [{
|
series: [{
|
||||||
name: '货位状态',
|
name: '货位状态',
|
||||||
type: 'pie',
|
type: 'pie',
|
||||||
|
|||||||
Reference in New Issue
Block a user