forked from github/dataease
Merge pull request #11064 from dataease/pr@dev-v2@refactor_multi_series_label_color
refactor(图表): 多序列标签字体颜色适配主题
This commit is contained in:
commit
078af9687d
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user