VisActor / VisActor/VChart

[Feature] 标签tick计算策略优化

Open
#3,848 0 comments 0 reactions 1 assignee View on GitHub

@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吗?

Image

在min:0.3,max:1.5的情况下,tickStep换成0.1右侧也不能显示完全。

Image

分析:
这应该是计算tick的时候数值插值不准确造成的,它的例子里,range: [0.3, 1.5], tickStep: 0.1, 计算出来最后一个tick是1.4000000001,那么下一个tick就是1.5000000001,而max是1.5,所以没绘制出来。
这是轴tick计算的通用逻辑,导致的bad case。普通坐标轴也是如此。

Image

What does the proposed API look like?

坐标轴按照tickStep展示

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.