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