mirror of
https://github.com/dataease/dataease.git
synced 2026-06-16 20:42:07 +08:00
fix(图表): 优化标签填充逻辑,支持函数和静态值,确保极值条件下的样式正确显示
This commit is contained in:
@@ -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'
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user