feat: gauge support clip when mark outof axis. close#3859#3895
Merged
feat: gauge support clip when mark outof axis. close#3859#3895
Conversation
xile611
reviewed
Apr 16, 2025
xile611
approved these changes
Apr 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
close #3859
🔗 Related PR link
🐞 Bugserver case id
67fe185f70dedf00a7f0322d
6800fca5f6d6fd00a872e8b2
6800fda1281bec00b05008bd
💡 Background and solution
针对 #3859 的问题分析 :
仪表图分为两种配置方式:
gauge: {type: 'circularProgress'}, 指使用环形进度系列,绘制仪表图(如果不指定type的话,默认使用环形进度系列)。

此时,会限制轴范围:
gauge: {type: 'gauge'},指使用仪表系列,绘制仪表图

此时,不限制轴范围:
对于上述demo:

demo1: 没有任何type指定,所以走的gauge: {type: 'circularProgress'},轴范围被限制在[0,1],当数据超过1,直接绘制超出范围。
demo2: 指定了gauge: {type: 'circularProgress'},但同时设置了tickMask,有了这个配置,绘制图元时会增加clipPath,所以绘制不会超出范围。
demo3: 指定了gauge: {type: 'gauge'}, 轴不会被指定范围,于是根据数据范围自动设置轴范围,所以图元绘制不会超出轴范围。
所以,统一绘制效果的方案:
新增一个配置
clamp?:boolean,超出轴范围,自动clamp结果:

📝 Changelog
☑️ Self-Check before Merge
🚀 Summary
copilot:summary
🔍 Walkthrough
copilot:walkthrough