fix(图表): 修复子弹图无法修改标签颜色的问题,以及当实际值与目标值使用同一个指标时,实际值颜色变成黑色的问题

This commit is contained in:
jianneng-fit2cloud
2025-09-18 18:52:14 +08:00
parent 5236b007a8
commit dac9cdf9d1

View File

@@ -235,8 +235,11 @@ export class BulletGraph extends G2ChartView<RuntimeOptions, G2Bullet> {
}
: false
}
const targetName =
let targetName =
chart.yAxisExt[0]?.chartShowName || bullet.bar.target.name || chart.yAxisExt[0]?.name
if (targetName === measureName) {
targetName = `${targetName} `
}
const target = {
type: 'point',
encode: {
@@ -399,7 +402,7 @@ export class BulletGraph extends G2ChartView<RuntimeOptions, G2Bullet> {
// exceedAdjust 自动对标签做溢出检测和矫正,即当标签超出视图区域时,会对标签自动做反方向的位移
// overlapHide 对位置碰撞的标签进行隐藏,默认保留前一个,隐藏后一个
const transform = {
transform: [{ type: 'contrastReverse' }, { type: 'exceedAdjust' }, { type: 'overlapHide' }]
transform: [{ type: 'exceedAdjust' }, { type: 'overlapHide' }]
}
// 配置标签样式
const label = {