Skip to content

fix(gauge): fix z2 is negative when maxVal is negative - #20276

Merged
Ovilia merged 1 commit into
apache:masterfrom
kingyue737:patch-1
Aug 26, 2024
Merged

Ovilia merged 1 commit into
apache:masterfrom
kingyue737:patch-1

Conversation

@kingyue737

Copy link
Copy Markdown
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

@Ovilia Ovilia left a comment

Copy link
Copy Markdown
Contributor

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?

@Ovilia Ovilia left a comment

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Aug 23, 2024 •

Copy link
Copy Markdown
Contributor

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

@Ovilia

Ovilia commented Aug 26, 2024

Copy link
Copy Markdown
Contributor

Online test case

@Ovilia Ovilia left a comment •

Copy link
Copy Markdown
Contributor

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
@echarts-bot

echarts-bot Bot commented Aug 26, 2024

Copy link
Copy Markdown

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
Copy Markdown
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