[Feature] 标签tick计算策略优化
Open
@skie1997 is already working on this.
Since Mar 26, 2025.
- Dominant language
- TypeScript
- Stars
- 1.8k
- Forks
- 221
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 26
Description
What problem does this feature solve?
线性轴配置min、max、tickStep后,tick展示不全。
问题说明:
我用min:0.5,max:1.5确实是正常的,但是换成min:0.3,max:1.5右侧就显示不全刻度了是因为什么呢,1.5-0.3=1.2不是也能整除tickStep的0.2吗?
在min:0.3,max:1.5的情况下,tickStep换成0.1右侧也不能显示完全。
分析:
这应该是计算tick的时候数值插值不准确造成的,它的例子里,range: [0.3, 1.5], tickStep: 0.1, 计算出来最后一个tick是1.4000000001,那么下一个tick就是1.5000000001,而max是1.5,所以没绘制出来。
这是轴tick计算的通用逻辑,导致的bad case。普通坐标轴也是如此。
What does the proposed API look like?
坐标轴按照tickStep展示
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.