apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.53k stars 19.61k forks source link

[Bug] gauge renderer 使用SVG,指针颜色设置inherit,颜色为黑色,与canvas渲染的不一致 #18779

Closed zhouzhili closed 1 year ago

zhouzhili commented 1 year ago

Version

5.4.2

Link to Minimal Reproduction

https://codepen.io/zhili124/pen/rNQLaBz

Steps to Reproduce

1、renderer 设置为svg 2、pointer: { width: 10, itemStyle: { color: 'inherit' } },

Current Behavior

指针的颜色是黑色

Expected Behavior

pointer的颜色与axisLine配置的颜色一致,与renderer 设置为canvas时表现一致

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

echarts-bot[bot] commented 1 year ago

@zhouzhili It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED
**TITLE** [Bug] gauge renderer uses SVG, pointer color set inherit, color is black, inconsistent with canvas rendering **BODY** ### Version 5.4.2 ### Link to Minimal Reproduction https://codepen.io/zhili124/pen/rNQLaBz ### Steps to Reproduce 1. Renderer is set to svg 2. ```pointer: { width: 10, itemStyle: { color: 'inherit' } },``` ### Current Behavior The pointer color is black ### Expected Behavior The color of the pointer is consistent with the color of the axisLine configuration, which is consistent with the performance when the renderer is set to canvas ### Environment ```markdown - OS: -Browser: - Framework: ``` ### Any additional comments? _No response_
plainheart commented 1 year ago

目前相关代码并未处理颜色为 inherit 的情况,文档也未说明其可以为 inherit,至于 canvas 可以正常显示是个“意外”,正确的值应该为 auto,不过这个情况后续也许可考虑处理下。

zhouzhili commented 1 year ago

我看官网的示例里面写的颜色是inherit,那应该是被示例误导了 https://echarts.apache.org/examples/zh/editor.html?c=gauge-stage

image