VChart
VChart copied to clipboard
【WIP】Feat/tooltip label width buffer
dom tooltip 的多行文本模式,可能会导致一些异常换行。原因是 canvas 的 measureText 的结果和 dom 环境的文本换行阈值不一致(measureText 计算出的宽度比 dom 需要的宽度略小)。
考虑支持 extraWidth 属性作为 tooltip 标签宽度的 buffer,在统一布局方法计算出 tooltip 标签宽度后,加上 extraWidth 属性并作用最终的 dom 标签宽度上。这样可以避免异常换行。
extraWidth 属性的默认值设在主题中,用户不用手动设置。
🤔 This is a ...
- [x] New feature
- [ ] Bug fix
- [ ] TypeScript definition update
- [ ] Bundle size optimization
- [ ] Performance optimization
- [ ] Enhancement feature
- [ ] Refactoring
- [ ] Update dependency
- [ ] Code style optimization
- [ ] Test Case
- [ ] Branch merge
- [ ] Release
- [ ] Site / documentation update
- [ ] Demo update
- [ ] Workflow
- [ ] Other (about what?)
🔗 Related issue link
🔗 Related PR link
🐞 Bugserver case id
💡 Background and solution
📝 Changelog
| Language | Changelog |
|---|---|
| 🇺🇸 English | |
| 🇨🇳 Chinese |
☑️ Self-Check before Merge
⚠️ Please check all items below before requesting a reviewing. ⚠️
- [ ] Doc is updated/provided or not needed
- [ ] Demo is updated/provided or not needed
- [ ] TypeScript definition is updated/provided or not needed
- [ ] Changelog is provided or not needed
🚀 Summary
copilot:summary
🔍 Walkthrough
copilot:walkthrough
优化方案待讨论