diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscSelector.vue index 2859ef6ef5..ee6ef95496 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/MiscSelector.vue @@ -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() } diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/liquid/liquid.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/liquid/liquid.ts index 9a22ed318b..35d77f5600 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/liquid/liquid.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/liquid/liquid.ts @@ -73,7 +73,9 @@ export class Liquid extends G2PlotChartView { }) }) // 处理空数据, 只要有一个指标是空数据,就不显示图表 - 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