Regarding the issue of relative position offset when customizing TextGuide
- Dominant language
- JavaScript
- Stars
- 8k
- Forks
- 637
- PR merge metrics
- No merged PRs in 30d
Description
- [ ] 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://github.com/xiaoyugege123/antv-f2-textguide-issue](https://github.com/xiaoyugege123/antv-f2-textguide-issue)
### Steps to reproduce
可以运行项目看看交互效果,也可以看看README.md文档中展现的情况
You can run the project to see the interaction effect, or you can check the situation shown in the README.md document
| Environment | Info |
|---|---|
| f2 | 5.7.4 |
| System | - |
| Browser | - |
---
业务需求上碰到这个问题,虽然没有很大问题,但是看出来还是不太完美的方案。希望能跟随柱状图形中间点位置来进行定位。这里看能不能直接计算文本内容长度来进行居中?希望能将这个文本居中直接写入进去
Encountering this issue in terms of business requirements, although it is not a major problem, it still appears to be an imperfect solution. I hope to follow the position of the middle point of the cylindrical shape for positioning. Can we directly calculate the length of the text content to center it here? I hope this text can be centered and written directly into it
Contributor guide
Research direction
Start with the linked reproduction project and its README.md, then inspect how the custom TextGuide is positioned relative to the bar. Reproduce the interaction in F2 5.7.4 and verify that the text is centered on the bar's middle point without requiring a manual offset.
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