Skip to content

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

Answered by pearmini
Deathsteps asked this question in Q&A
Discussion options

You must be logged in to vote
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', style: { pointerEvents: 'none' } }); // 完整看这里

chart.render();

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pearmini
Comment options

Answer selected by hustcc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #5216 on June 25, 2023 02:06.