Skip to content
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

fix(gauge): fix progress bar may become unexpectedly circle when value is 0 and progress.roundCap is enabled. #16653

Merged
merged 1 commit into from
Mar 21, 2022

Conversation

plainheart
Copy link
Member

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

  1. Fix progress bar may become unexpectedly circle when value is 0 and progress.roundCap is enabled.
  2. Fix ticks don't follow the axis direction when the chart is anticlockwise.

Fixed issues

Details

Before: What was the problem?

After: How is it fixed in this PR?

Misc

  • The API has been changed (apache/echarts-doc#xxx).
  • This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

Please refer to test/gauge-case.html.

Others

Merging options

  • Please squash the commits into a single one when merging.

Other information

… `0` and `progress.roundCap` is enabled, resolves #16640.
@echarts-bot
Copy link

echarts-bot bot commented Mar 9, 2022

Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

The pull request is marked to be PR: author is committer because you are a committer of this project.

@plainheart
Copy link
Member Author

It seems the clock test case in gauge-pointer.html doesn't work perfectly. There will be an unexpected rotation when the second becomes 0 from 59.

@pissang
Copy link
Contributor

pissang commented Mar 15, 2022

@plainheart

Sorry for the late reply. Seems when the pointer switching from 59 to 60. The startAngle and endAngle will be switched and the angleRangeSpan will be negative after normalizeArcAngles

Seems it's bacause in the case the clockwise is set to false when from 59 to 60. Similar case on the example https://echarts.apache.org/examples/zh/editor.html?c=gauge-clock&lang=js didn't have this issue.

@pissang
Copy link
Contributor

pissang commented Mar 15, 2022

It also fixes the issue when startAngle is set smaller than endAngle.

Before:
image

After:
image

There is another undefined behavior when the angle span is larger than 360. The old logic will mod the angles and current will treat it as a circle.

Before:
image

After:
image

From my side the new behavior is more expected.

@plainheart
Copy link
Member Author

plainheart commented Mar 15, 2022

Seems it's bacause in the case the clockwise is set to false when from 59 to 60. Similar case on the example https://echarts.apache.org/examples/zh/editor.html?c=gauge-clock&lang=js didn't have this issue.

@pissang The example on the website looks well since it disables the animation when the pointer is 60. And we can see the switch from 59 to 60 has no animation.

@pissang
Copy link
Contributor

pissang commented Mar 21, 2022

LGTM

@plainheart plainheart merged commit a4cda9f into master Mar 21, 2022
@echarts-bot
Copy link

echarts-bot bot commented Mar 21, 2022

Congratulations! Your PR has been merged. Thanks for your contribution! 👍

@plainheart plainheart deleted the fix-gauge branch March 21, 2022 05:55
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] 仪表盘设置value为0时出现满圆覆盖图形
2 participants