From 4622e1f98b1e6f4673441fbd1ff25dd45c989656 Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Thu, 18 Sep 2025 16:55:14 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=A0=86=E5=8F=A0=E6=9F=B1=E7=8A=B6=E5=9B=BE=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=80=BB=E8=AE=A1=E7=9A=84=E9=97=AE=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/stack-bar.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/g2/bar/stack-bar.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/g2/bar/stack-bar.ts index 9a1f39a486..f2b05c15ba 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/g2/bar/stack-bar.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/g2/bar/stack-bar.ts @@ -16,7 +16,7 @@ import { TOOLTIP_ITEM_TPL, TOOLTIP_TITLE_TPL } from '@/views/chart/components/js/panel/common/common_antv' -import { defaultsDeep, isEmpty } from 'lodash-es' +import { isEmpty } from 'lodash-es' /** * 堆叠柱状图 @@ -74,7 +74,7 @@ export class StackBar extends Bar { if (labelAttr.showTotal) { const formatterCfg = labelAttr.labelFormatter ?? formatterItem - const groupedData = groupBy(children[0].data.value, 'field') + const groupedData = groupBy(options.data, 'field') for (const [key, values] of Object.entries(groupedData)) { const total = values.reduce((a, b) => a + b.value, 0) const value = valueFormatter(total, formatterCfg)