fix(图表): 优化标签填充逻辑,支持函数和静态值,确保极值条件下的样式正确显示

This commit is contained in:
jianneng-fit2cloud
2026-05-27 18:10:30 +08:00
parent ec09d70b9e
commit a4bb7b6614

View File

@@ -98,10 +98,17 @@ export const extremumEvt = (
.forEach(item => {
item.labels.forEach(label => {
const oldPosition = label.position || 'top'
const oldFill = label.style?.fill
label.style = {
...label.style,
fill: data => {
if (data.extremum) return ''
if (typeof oldFill === 'function') {
return oldFill(data)
}
if (oldFill) {
return oldFill
}
const cfg = isSeriesLabel ? formatterMap[data.quotaList?.[0]?.id] : labelAttr
return cfg?.color ?? '#000'
},