antvis / antvis/F2

折线图点击空白区域出现多余的数据

Open
#1,187 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
8k
Forks
637
PR merge metrics
No merged PRs in 30d

Description

刚开始渲染两个月数据,没有问题,切换月份后只剩一个月数据再次渲染时,之前月份的数据在点击空白出会显示出来

```js
const chart = new F2.Chart({
el: chartRef.current,
pixelRatio: window.devicePixelRatio,
width: window.innerWidth - 24,
height: 300,
plugins: [Animation, Tooltip],
});
chart.clear();
chart.source(source);
chart.line().position('dateId*value').shape('smooth');
chart.tooltip({
alwaysShow: true,
triggerOn: 'touchstart',
onChange: obj => {
const { items } = obj;
items[0].name = items[0].title;
},
});
chart.render();
```

`f2版本:3.8.9`

![test](https://user-images.githubusercontent.com/6970789/123398712-6d653900-d5d6-11eb-917b-24d8e59cbb49.gif)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the two-month-to-one-month update using the F2 3.8.9 chart setup shown in the issue, especially the chart.clear(), chart.source(source), and chart.render() sequence. Inspect how tooltip data is retained after the source changes. Done means tapping an empty area after switching months no longer shows data from the previous month.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.