Skip to content

Conversation

@StNimmerlein
Copy link

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Apply correct color to gauge chart progress when set to 'auto' in svg renderer.

Fixed issues

Details

Before: What was the problem?

See the issue for more details.

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

@echarts-bot
Copy link

echarts-bot bot commented Aug 25, 2025

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.

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 think we should make this a new feature rather than bug fixing because 'auto' was not mentioned in the current doc. Please also make a pull request to the doc repo. Thanks!

progress.useStyle(data.getItemVisual(idx, 'style'));
progress.setStyle(itemModel.getModel(['progress', 'itemStyle']).getItemStyle());
if (progress.style.fill === 'auto') {
progress.setStyle('fill', getColor(
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be the same as in the above pointer. Let's create a autoColor after the const emphasisDisabled = emphasisModel.get('disabled'); line like:

const autoColor = (showPointer || showProgress)
    ? getColor(...)
    : null;

Copy link
Author

Choose a reason for hiding this comment

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

I extracted the variable, but without the ternary (so it could be used in other cases as well).
If you prefer the ternary to be there for performance purposes, I can add it.

@Ovilia Ovilia changed the title fix(gauge): apply correct color to progress when set to 'auto' feat(gauge): progress.color supports 'auto' Sep 2, 2025
@Ovilia Ovilia added PR: awaiting doc Document changes is required for this PR. and removed PR: awaiting review PR: doc unchanged labels Sep 2, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 2, 2025

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

@StNimmerlein
Copy link
Author

I think we should make this a new feature rather than bug fixing because 'auto' was not mentioned in the current doc. Please also make a pull request to the doc repo. Thanks!

In this section "auto" is mentioned for the pointer's color: https://github.com/apache/echarts-doc/blob/master/en/option/series/gauge.md#colorcolor--auto
Would it suffice to extend this paragraph by changing it to "The color of pointer and progress [...]"?

@Ovilia
Copy link
Contributor

Ovilia commented Sep 8, 2025

I think we should make this a new feature rather than bug fixing because 'auto' was not mentioned in the current doc. Please also make a pull request to the doc repo. Thanks!

In this section "auto" is mentioned for the pointer's color: https://github.com/apache/echarts-doc/blob/master/en/option/series/gauge.md#colorcolor--auto Would it suffice to extend this paragraph by changing it to "The color of pointer and progress [...]"?

Yes, please help copy and paste it to pointer and progress color. Thanks!

@Ovilia Ovilia merged commit b94047f into apache:master Sep 8, 2025
1 of 2 checks passed
@echarts-bot
Copy link

echarts-bot bot commented Sep 8, 2025

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

@Ovilia
Copy link
Contributor

Ovilia commented Sep 8, 2025

Thanks for your contribution!

@Ovilia Ovilia added this to the 6.0.1 milestone Sep 8, 2025
@plainheart plainheart changed the title feat(gauge): progress.color supports 'auto' feat(gauge): progress.color supports 'auto' Dec 16, 2025
@echarts-bot echarts-bot bot added PR: doc unchanged and removed PR: awaiting doc Document changes is required for this PR. labels Dec 16, 2025
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 progress 'auto' color not reflected when using SVG renderer

2 participants