Merge pull request #11064 from dataease/pr@dev-v2@refactor_multi_series_label_color

refactor(图表): 多序列标签字体颜色适配主题
This commit is contained in:
wisonic-s 2024-07-22 10:49:01 +08:00 committed by GitHub
commit 078af9687d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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