Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【v5】散点图开启 label,label 会遮住 point 导致 tooltip 不显示 #5216

Closed
Deathsteps opened this issue Jun 21, 2023 · 1 comment

Comments

@Deathsteps
Copy link
Contributor

问题描述

无 label 设定效果
image

有 label 设定,tooltip 无法触发
image

期望结果

从体验上讲 label 应该不影响 tooltip 触发。
官方的数据点比较多,可能比较明显,真实情况可能没这么多点,但点与点距离是数据决定的。label 就算有偏移,长度也是不可控的,大概率也会有遮挡情况。

如何重现

官方代码修改

import { Chart } from '@antv/g2';

const chart = new Chart({
  container: 'container',
  theme: 'classic',
  autoFit: true,
});

chart
  .point()
  .data({
    type: 'fetch',
    value:
      'https://gw.alipayobjects.com/os/basement_prod/6b4aa721-b039-49b9-99d8-540b3f87d339.json',
  })
  .encode('x', 'height')
  .encode('y', 'weight')
  .encode('color', 'gender')
  .label({ text: 'weight' });

chart.render();

额外信息

  • G2 5.0.12 版本
@hustcc
Copy link
Member

hustcc commented Jun 21, 2023

label.style.pointerEvents = 'none'

@antvis antvis locked and limited conversation to collaborators Jun 25, 2023
@pearmini pearmini converted this issue into discussion #5222 Jun 25, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants