From 464f1ee29de87a081bd73d3936a2112fc34e4d00 Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Mon, 18 May 2026 18:12:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E6=9F=B1=E7=8A=B6=E5=9B=BE=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E6=A0=B7=E5=BC=8F=E5=AF=BC=E8=87=B4=E6=9F=B1?= =?UTF-8?q?=E4=BD=93=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/components/js/panel/charts/g2/bar/bar.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/g2/bar/bar.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/g2/bar/bar.ts index 5fa23f90bf..4df495ecc9 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/g2/bar/bar.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/g2/bar/bar.ts @@ -701,10 +701,11 @@ export class Bar extends G2ChartView { const cColor = this.getColorByConditions([].concat(q), currentValue, chart) if (cColor) { item.conditionColor.push(cColor) - } else { - item.conditionColor = undefined } }) + if (!item.conditionColor.length) { + item.conditionColor = undefined + } }) return data } @@ -720,9 +721,10 @@ export class Bar extends G2ChartView { options.children[0].style = { ...options.children[0].style, fill: d => { - if (d.conditionColor) { - return d.conditionColor + if (d.conditionColor?.length) { + return d.conditionColor[0] } + return d.color } } return options