antvis/G2






The issue has been closed
借助图形标注展示总计 label 显示错误 #5960
iTsingchen posted onGitHub
问题描述
基于 Ant Design Charts 提供的官方 demo 借助图形标注展示总计 label ,如果输入的值过小,而且通过 style.text
传入则会 label 不正确,可以通过将 style.text
传入函数进行规避问题
重现链接
重现步骤
- 将 annotations 中的
style.text
设置为字符串 - 数据中的值包含较小的值(小于 x 轴 label 长度的值)
预期行为
正确的显示 style.text
中设置的值
屏幕截图或视频
<img width="672" alt="image" src="https://github.com/antvis/G2/assets/19379305/608ae8c6-df55-4008-b53f-639b22c240b3">
补充说明
没太懂 1339 行为啥判断的是 typeof value !== 'string'
,而不是typeof value === 'string'