antvis / antvis/G2

stack 时间格式 resize后 tooltip hover部分轴不显示

Open
#6,453 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
12.6k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### 问题描述

stack 时间格式 resize后 tooltip hover部分轴不显示

复现代码

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

const data = [
{
type: 'less_one_hour',
timestamp: '2024/9/2',
value: 41,
wait_per_card: 9,
},
{
type: 'above_one_hour',
timestamp: '2024/9/2',
value: 2,
wait_per_card: 9,
},
{
type: 'above_four_hours',
timestamp: '2024/9/2',
value: 8,
wait_per_card: 9,
},
{
type: 'above_two_hours',
timestamp: '2024/9/2',
value: 2,
wait_per_card: 9,
},
{
type: 'less_one_hour',
timestamp: '2024/8/28',
value: 31,
wait_per_card: 11,
},
{
type: 'above_one_hour',
timestamp: '2024/8/28',
value: 3,
wait_per_card: 11,
},
{
type: 'above_four_hours',
timestamp: '2024/8/28',
value: 7,
wait_per_card: 11,
},
{
type: 'above_two_hours',
timestamp: '2024/8/28',
value: 1,
wait_per_card: 11,
},
// {
// type: 'less_one_hour',
// timestamp: '2024/8/30',
// value: 38,
// wait_per_card: 11,
// },
// {
// type: 'above_one_hour',
// timestamp: '2024/8/30',
// value: 1,
// wait_per_card: 11,
// },
// {
// type: 'above_four_hours',
// timestamp: '2024/8/30',
// value: 6,
// wait_per_card: 11,
// },
// {
// type: 'above_two_hours',
// timestamp: '2024/8/30',
// value: 1,
// wait_per_card: 11,
// },
{
type: 'less_one_hour',
timestamp: '2024/8/29',
value: 36,
wait_per_card: 8,
},
{
type: 'above_one_hour',
timestamp: '2024/8/29',
value: 0,
wait_per_card: 8,
},
{
type: 'above_four_hours',
timestamp: '2024/8/29',
value: 7,
wait_per_card: 8,
},
{
type: 'above_two_hours',
timestamp: '2024/8/29',
value: 5,
wait_per_card: 8,
},
{
type: 'less_one_hour',
timestamp: '2024/8/31',
value: 3,
wait_per_card: 0,
},
{
type: 'above_one_hour',
timestamp: '2024/8/31',
value: 0,
wait_per_card: 0,
},
{
type: 'above_four_hours',
timestamp: '2024/8/31',
value: 0,
wait_per_card: 0,
},
{
type: 'above_two_hours',
timestamp: '2024/8/31',
value: 0,
wait_per_card: 0,
},
{
type: 'less_one_hour',
timestamp: '2024/9/1',
value: 4,
wait_per_card: 0,
},
{
type: 'above_one_hour',
timestamp: '2024/9/1',
value: 0,
wait_per_card: 0,
},
{
type: 'above_four_hours',
timestamp: '2024/9/1',
value: 0,
wait_per_card: 0,
},
{
type: 'above_two_hours',
timestamp: '2024/9/1',
value: 0,
wait_per_card: 0,
},
]

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

chart.data(data);
chart.scale('value', {
nice: true,
});
chart.tooltip({
shared: true,
});

chart
.interval()
.position('timestamp*value')
.color('type')
.adjust('stack');

chart.interaction('active-region');

chart.render();
```

### 重现链接

[recording.webm](https://github.com/user-attachments/assets/c765d5b6-745f-46b1-8142-b90ac44fbb14)

https://g2-v4.antv.vision/en/examples/column/stack#stacked

### 重现步骤

见录屏

### 预期行为

_No response_

### 平台

- 操作系统: [macOS, Windows, Linux, React Native ...]
- 网页浏览器: [Google Chrome, Safari, Firefox]

Contributor guide

Open the contributing guide

Research direction

Start with the embedded TypeScript/JavaScript reproduction and the linked G2 stacked example; resize the chart, then inspect the tooltip and active-region interaction. Compare which stacked axes produce hover output before and after resizing. Done means tooltip hover consistently appears for every relevant axis after resize.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.