G2 icon indicating copy to clipboard operation
G2 copied to clipboard

[Bug]: 密度热力图tooltip显示的数据不随鼠标移动更新

Open hfdy0935 opened this issue 10 months ago • 1 comments

Describe the bug / 问题描述

密度热力图开启tooltip时,数据不随鼠标移动更新; 比如下面这张图,无论鼠标怎么移动,tooltip始终显示第一个点的数据

Image

Reproduction link / 复现链接

https://stackblitz.com/edit/react-uwwgnvtc

Steps to Reproduce the Bug or Issue / 重现步骤

重现方式:官网的例子(https://g2.antv.antgroup.com/examples/general/heatmap/#heatmap )去掉heatmap的.tooltip(false)让提示显示,或者用上面StackBlitz的链接 );

Version / 版本

🆕 5.x

OS / 操作系统

  • [ ] macOS
  • [x] Windows
  • [ ] Linux
  • [ ] Others / 其他

Browser / 浏览器

  • [x] Chrome
  • [ ] Edge
  • [ ] Firefox
  • [ ] Safari (Limited support / 有限支持)
  • [ ] IE (Nonsupport / 不支持)
  • [ ] Others / 其他

hfdy0935 avatar Feb 20 '25 09:02 hfdy0935

热力图的绘制只返回了一个索引,后面数据绑定的时候导致所有数据都是同一份,需要在tooltip item拾取的时候做特殊处理。

Image

interstellarmt avatar Feb 27 '25 02:02 interstellarmt