From 713ec08c5d5053623bdfd9f1f2480bc1a30cb9cf Mon Sep 17 00:00:00 2001 From: wisonic Date: Mon, 22 Jul 2024 10:47:53 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E5=9B=BE=E8=A1=A8):=20=E5=A4=9A?= =?UTF-8?q?=E5=BA=8F=E5=88=97=E6=A0=87=E7=AD=BE=E5=AD=97=E4=BD=93=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E9=80=82=E9=85=8D=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/components/editor/editor-style/ChartStyle.vue | 2 +- .../editor/editor-style/components/LabelSelector.vue | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue index 06330d8276..be2a4bb9f6 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue @@ -347,7 +347,7 @@ watch( v-model="chart.customAttr.label.show" :change-model="chart.customAttr.label" @modelChange="val => onLabelChange(val, 'show')" - :title="$t('chart.label') + '11'" + :title="$t('chart.label')" name="label" > { let tmp = { ...next, show: true, - color: COMPUTED_DEFAULT_LABEL.value.color, + color: props.themes === 'dark' ? '#fff' : '#000', fontSize: COMPUTED_DEFAULT_LABEL.value.fontSize, showExtremum: false } as SeriesFormatter @@ -106,6 +106,10 @@ const initSeriesLabel = () => { pre[next.id] = tmp return pre }, {}) + // 初始化一下序列数组,用于主题适配 + if (!props.chart.customAttr.label.seriesLabelFormatter?.length) { + changeLabelAttr('seriesLabelFormatter') + } if (!curSeriesFormatter.value || !axisMap[curSeriesFormatter.value.id]) { curSeriesFormatter.value = axisMap[formatter[0].id] return