10000 feat: gauge support clip when mark outof axis. close#3859 by skie1997 · Pull Request #3895 · VisActor/VChart · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: gauge support clip when mark outof axis. close#3859 #3895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 18, 2025

Conversation

skie1997
Copy link
Contributor
@skie1997 skie1997 commented Apr 15, 2025

[中文版模板 / Chinese template]

🤔 This is a ...

  • 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

close #3859

🔗 Related PR link

🐞 Bugserver case id

67fe185f70dedf00a7f0322d
6800fca5f6d6fd00a872e8b2
6800fda1281bec00b05008bd

💡 Background and solution

针对 #3859 的问题分析 :
仪表图分为两种配置方式:

  1. gauge: {type: 'circularProgress'}, 指使用环形进度系列,绘制仪表图(如果不指定type的话,默认使用环形进度系列)。
    此时,会限制轴范围:
    Image

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

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

所以,统一绘制效果的方案:
新增一个配置clamp?:boolean,超出轴范围,自动clamp

结果:
image

📝 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

@xile611 xile611 added this to the 1.13.9 milestone Apr 16, 2025
@skie1997 skie1997 requested a review from xile611 April 17, 2025 13:23
@xile611 xile611 merged commit 63c289d into develop Apr 18, 2025
6 of 10 checks passed
@xile611 xile611 deleted the feat/gauge-clip branch April 18, 2025 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] 仪表图设置数据超出0-1范围后,刻度仪表图与普通仪表图的渲染表现不一致
2 participants
0