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 z2 is negative when maxVal is negative #20276

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

kingyue737
Copy link
Contributor

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

When max of a gauge is negative, the z2 calculated is also negative. Thus the axisLine is on top of the progress bar. This PR fixes how z2 is calculated to ensure it is always non-negative.

Fixed issues

fix #20097

Details

Before: What was the problem?

The progress bar is beneath the axisLine.

image

After: How does it behave after the fixing?

image

Document Info

One of the following should be checked.

  • This PR doesn't relate to document changes
  • The document should be updated later
  • The document changes have been made in apache/echarts-doc#xxx

Misc

ZRender Changes

  • This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

N.A.

Others

Merging options

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

Other information

Copy link
Contributor

@Ovilia Ovilia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think #20097 should be a bug. I commented at #20097 (comment) . Can you have a look, please?

Copy link
Contributor

@Ovilia Ovilia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that you can use linearMap in src/util/number.ts

Copy link
Contributor

github-actions bot commented Aug 23, 2024

The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-20276@88345fe

@Ovilia
Copy link
Contributor

Ovilia commented Aug 26, 2024

Online test case

Copy link
Contributor

@Ovilia Ovilia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

A minor tip: please don't use force push next time. This will lose the commit history and our discussion context. We will use "squash and merge" if there are too many unnecessary commits.

@Ovilia Ovilia merged commit 52e4006 into apache:master Aug 26, 2024
2 checks passed
Copy link

echarts-bot bot commented Aug 26, 2024

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

@Ovilia Ovilia added this to the 5.5.2 milestone Aug 26, 2024
@kingyue737 kingyue737 deleted the patch-1 branch August 26, 2024 07:33
@kingyue737
Copy link
Contributor Author

A minor tip: please don't use force push next time. This will lose the commit history and our discussion context. We will use "squash and merge" if there are too many unnecessary commits.

Thanks very much for your advice!

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] Gauge chart: Progress axis color disappears on negative min max limit
2 participants