Skip to content
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】elementHighlightByColor 和 scale.y.key 一起设置 hover 会报错 #5546

Closed
Deathsteps opened this issue Sep 14, 2023 · 3 comments
Closed

Comments

@Deathsteps
Copy link
Contributor

Deathsteps commented Sep 14, 2023

问题描述

由于报错,导致真实项目里,tooltip 滑出图表区外也不会消失,或者在 hover 过程中 tooltip 显示数据错误

image

期望结果

不要报错,双轴图下同时设置这两个东西很正常

如何重现

官方代码修改

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

const data = [
  { time: '10:10', call: 4, waiting: 2, people: 2 },
  { time: '10:15', call: 2, waiting: 6, people: 3 },
  { time: '10:20', call: 13, waiting: 2, people: 5 },
  { time: '10:25', call: 9, waiting: 9, people: 1 },
  { time: '10:30', call: 5, waiting: 2, people: 3 },
  { time: '10:35', call: 8, waiting: 2, people: 1 },
  { time: '10:40', call: 13, waiting: 1, people: 2 },
];

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

chart.data(data);

chart
  .interval()
  .encode('x', 'time')
  .encode('y', 'waiting')
  .scale('y', { key: 'main' })
  .axis('y', { title: 'Waiting', titleFill: '#5B8FF9' });

chart.interaction("elementHighlightByColor", {
  link: false,
  background: true
});

chart.render();

额外信息

  • G2 5.1.2 版本
@pearmini
Copy link
Member

应该是类似的问题:#5535

@Deathsteps
Copy link
Contributor Author

汗,原来之前就发现了。两个问题出发点不一样,我自已晕了:sweat_smile:

@pearmini
Copy link
Member

应该是类似的问题:#5535

重复 issue 先关闭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants