refactor(图表): 多序列标签字体颜色适配主题

This commit is contained in:
wisonic 2024-07-22 10:47:53 +08:00
parent a1100f22f1
commit 713ec08c5d
2 changed files with 6 additions and 2 deletions

View File

@ -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"
>
<label-selector

View File

@ -88,7 +88,7 @@ const initSeriesLabel = () => {
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