折线图点击空白区域出现多余的数据
- 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`

Contributor 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