antvis / antvis/G2

[Bug]: 多轴图数据缺失的时候,tooltip title 显示异常

Open
#6,699 7 comments 0 reactions 1 assignee Claimed by @hustcc View on GitHub
bug 🐛 OSCP
Dominant language
TypeScript
Stars
12.6k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug / 问题描述

tooltip显示相关问题,柱状图堆叠+折线图,部分时间X轴对应的Y轴没有值,这种情况显示的tooltip异常

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

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

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: 6, people: 3 },
{ time: '10:35', call: 8, waiting: null, people: null },
{ time: '10:40', call: 13, waiting: 3, people: 2 },
];

chart.data(data);

chart
.interval()
.encode('x', 'time')
.encode('y', 'waiting')
.encode('color', () => 'waiting')

chart
.interval()
.encode('x', 'time')
.encode('y', 'people')
.encode('color', () => 'people')

chart
.line()
.encode('x', 'time')
.encode('y', 'call')
.encode('color', () => 'call')

chart.render();
```

![Image](https://github.com/user-attachments/assets/a1cc23ec-ebed-447c-967e-0ed1d73ac92f)

### Reproduction link / 复现链接

_No response_

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

_No response_

### Version / 版本

🆕 5.x

### OS / 操作系统

- [ ] macOS
- [ ] Windows
- [ ] Linux
- [ ] Others / 其他

### Browser / 浏览器

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.