F2 icon indicating copy to clipboard operation
F2 copied to clipboard

自定义tooltips无法使用

Open Ailys-jack opened this issue 2 years ago • 2 comments

  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

https://f2.antv.antgroup.com/examples/area/area/#gradient

Steps to reproduce

最新版可复现,官网demo也可复现,随便在一个面积图加 <Tooltip showCrosshairs customText={()=> 测试自定义tip}/> 就报错了,还有什么方式能自定义Tooltip内容?

Environment Info
f2 5.0.25
System -
Browser -

Ailys-jack avatar Jun 14 '23 02:06 Ailys-jack

我用了源码里的示例,没报错能显示哎 <Tooltip alwaysShow={true} showTooltipMarker={true} defaultItem={data[0]} customText={(record) => { const { origin } = record; return ( <text attrs={{ fill: '#fff', text: 名称:${origin.genre}, }} /> ); }} />

image

LiuJing1014 avatar Jan 19 '24 02:01 LiuJing1014

我用了源码里的示例,没报错能显示哎 <Tooltip alwaysShow={true} showTooltipMarker={true} defaultItem={data[0]} customText={(record) => { const { origin } = record; return ( <text attrs={{ fill: '#fff', text: 名称:${origin.genre}, }} /> ); }} />

image

您好,为什么在文档里我找寻不到这个customText https://f2.antv.antgroup.com/tutorial/shape-attrs#%E6%96%87%E6%9C%AC%E5%B1%9E%E6%80%A7

LLmoskk avatar Jun 09 '24 06:06 LLmoskk