fix(图表): 修复仪表盘和水波图值为 0 时显示异常 #16419

This commit is contained in:
wisonic
2025-08-05 17:44:48 +08:00
committed by wisonic-s
parent 1644d81dff
commit 7e9c9ddeef
2 changed files with 4 additions and 2 deletions

View File

@@ -57,7 +57,7 @@ const gaugeLiquidYaxisValue = args => {
const key = type === 'gauge' ? 'gaugeMax' : type === 'liquid' ? 'liquidMax' : null
if (key) {
gaugeLiquidYaxisDefaultValue[key] = cloneDeep(max)
if (!state.miscForm[key]) {
if (state.miscForm[key] === undefined || state.miscForm[key] === null) {
state.miscForm[key] = gaugeLiquidYaxisDefaultValue[key]
changeMisc()
}

View File

@@ -73,7 +73,9 @@ export class Liquid extends G2PlotChartView<LiquidOptions, G2Liquid> {
})
})
// 处理空数据, 只要有一个指标是空数据,就不显示图表
const hasNoneData = chart.data?.series.some(s => !s.data?.[0])
const hasNoneData = chart.data?.series.some(
s => s.data?.[0] === undefined || s.data?.[0] === null
)
this.configEmptyDataStyle(hasNoneData ? [] : [1], container, newChart)
if (hasNoneData) {
return