antvis/G2

hover 至某些图表的label 无法触发 tooltip 提示 #6392

javanoclaw posted onGitHub

问题描述

如题,参考官网示例,hover 至某些图表的label 无法触发 tooltip 提示。 https://g2.antv.antgroup.com/examples/general/interval/#bar-stacked-diverging-rounded

重现链接

No response

重现步骤

1.打开官网示例 2.鼠标移动至label

预期行为

hover 至某些图表的label 触发 tooltip 提示

平台

  • 操作系统: Ubuntu 23.10
  • 网页浏览器: Google Chrome

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


因为标签捕获了事件,这个是符合预期的,类似于我们用 html 画页面一样的,可以设置不捕获事件。

.label({
    text: 'value',
    position: 'inside',
    formatter: (v) => (v ? `${v}%` : ''),
    transform: [{ type: 'overlapDodgeY' }],
    fill: '#000',
    fontSize: 10,
    pointerEvents: 'none'  // 这里,和 css 一致
  })
posted by hustcc 9 months ago

Fund this Issue

$0.00
Funded

Pull requests