feat(gauge): progress.color supports 'auto'#21224
Conversation
|
Thanks for your contribution! |
| progress.useStyle(data.getItemVisual(idx, 'style')); | ||
| progress.setStyle(itemModel.getModel(['progress', 'itemStyle']).getItemStyle()); | ||
| if (progress.style.fill === 'auto') { | ||
| progress.setStyle('fill', getColor( |
There was a problem hiding this comment.
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;There was a problem hiding this comment.
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.
|
The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-21224@0b06d7f |
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 |
Yes, please help copy and paste it to |
|
Congratulations! Your PR has been merged. Thanks for your contribution! 👍 |
|
Thanks for your contribution! |
progress.color supports 'auto'
Brief Information
This pull request is in the type of:
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.
After: How does it behave after the fixing?
Document Info
One of the following should be checked.
Misc
ZRender Changes
Related test cases or examples to use the new APIs
N.A.
Others
Merging options
Other information