feat(scale): add groupTransform for scales to support sync dual axes #6380
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
groupTransform
给 scale 添加 groupTransform 配置,可以用于同步双轴图的坐标刻度。
其中 syncTicksOfDomainsFromZero 的定义如下:
该方法有一个限制:所有的比例尺的 domain 都是从0开始的,简单的思路如下:
因为该方法有所局限(不过也覆盖大多数场景),并且没有充分测试,所以先不内置。不过,会在案例中透出,用户通过复制使用并且优化。之后该方法成熟之后,可以添加 syncTicks 这个配置: