初始化时,给定宽高,导致绑定的点击事件获取位置有偏差
- Dominant language
- JavaScript
- Stars
- 8k
- Forks
- 637
- PR merge metrics
- No merged PRs in 30d
Description
- [x] I have searched the [issues](https://github.com/antvis/f2/issues) of this repository and believe that this is not a duplicate.
### Reproduction link
[](https://codesandbox.io/s/beautiful-mcnulty-ffhq4?file=/src/App.vue&resolutionWidth=375&resolutionHeight=667)
### Steps to reproduce
点击第一个折线图,发现要左偏移一点才能点到对应的位置;
点击第二个折线图,发现获取的点位置是超出范围的,导致拿不到data;
https://drive.google.com/file/d/1m6BEcdYbLGVkDxcjGlOrKzeLI02SlHJ9/view?usp=sharing
| Environment | Info |
|---|---|
| f2 | 3.8.8 |
| System | - |
| Browser | - |
Contributor guide
Research direction
Start with the linked CodeSandbox reproduction, especially src/App.vue, using F2 3.8.8 and the stated viewport sizes. Compare click handling on the two line charts when width and height are supplied at initialization; done means both charts map clicks to the correct data point without an offset or out-of-range position.
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