antvis/G2

进行groupX聚合运算的图表,添加对应属性的数据标签label显示不正确 #6248

CODPHISH posted onGitHub

问题描述

image 如图中所示,官方示例中仅添加.label({text: 'price'}),数据标签显示的仍是原始数据,而非聚合后的数据

重现链接

No response

重现步骤

No response

预期行为

No response

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


这应该是一个 bug,我看看有没有办法解决。

posted by pearmini 11 months ago

@CODPHISH 这个 PR https://github.com/antvis/G2/pull/6250 引入了新的 API 解决了这个问题:

chart.interval().label({ 
  text: (d, i, data, {channel}) => channel.y[i]
})
posted by pearmini 11 months ago

Fund this Issue

$0.00
Funded

Pull requests