From c0e600bdb1dd0693b4f30e04cfe6ca7462b153bb Mon Sep 17 00:00:00 2001 From: wisonic Date: Mon, 14 Oct 2024 19:30:59 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=9B=BE=E8=A1=A8):=20=E5=88=86?= =?UTF-8?q?=E7=BB=84=E5=A0=86=E5=8F=A0=E6=9F=B1=E7=8A=B6=E5=9B=BE=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E6=80=BB=E8=AE=A1=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/components/js/panel/charts/bar/bar.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bar.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bar.ts index 2a845abad0..691da4991e 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bar.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/bar/bar.ts @@ -436,10 +436,11 @@ export class GroupBar extends StackBar { } protected configLabel(chart: Chart, options: ColumnOptions): ColumnOptions { - const baseOptions = super.configLabel(chart, options) - if (!baseOptions.label) { - return baseOptions + const tmpLabel = getLabel(chart) + if (!tmpLabel) { + return options } + const baseOptions = { ...options, label: tmpLabel } const { label: labelAttr } = parseJson(chart.customAttr) baseOptions.label.style.fill = labelAttr.color const label = { @@ -517,10 +518,11 @@ export class GroupStackBar extends StackBar { } protected configLabel(chart: Chart, options: ColumnOptions): ColumnOptions { - const baseOptions = super.configLabel(chart, options) - if (!baseOptions.label) { - return baseOptions + const tmpLabel = getLabel(chart) + if (!tmpLabel) { + return options } + const baseOptions = { ...options, label: tmpLabel } const { label: labelAttr } = parseJson(chart.customAttr) baseOptions.label.style.fill = labelAttr.color const label = {