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

[Bug] itemStyle.color配置成回调函数时,lineStyle.color无效 #20042

Closed
never51463 opened this issue Jun 18, 2024 · 8 comments
Closed

Comments

@never51463
Copy link

Version

e.g. 5.5.0

Link to Minimal Reproduction

#10910

Steps to Reproduce

配置series-line.itemStyle.color作为回调函数时,只有拐点变色,lineStyle没有按文档所说的会根据itemStyle.color取值
企业微信截图_17186920882953
企业微信截图_17186921122638

该问题与19年被提出并且被修复过,现在在新版本重新出现该问题并且没有解决

Current Behavior

当itemStyle的color使用回调函数时,线条颜色不能产生相应变化

Expected Behavior

当itemStyle的color使用回调函数时,线条颜色也能产生相应变化

Environment

- OS:windows 10
- Browser: 
- Framework:

Any additional comments?

No response

@never51463 never51463 added the bug label Jun 18, 2024
@echarts-bot echarts-bot bot added the pending We are not sure about whether this is a bug/new feature. label Jun 18, 2024
Copy link

echarts-bot bot commented Jun 18, 2024

@never51463 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

BODY

Version

e.g. 5.5.0

Link to Minimal Reproduction

#10910

Steps to Reproduce

When configuring series-line.itemStyle.color as the callback function, only the inflection point changes color, and lineStyle does not take the value according to itemStyle.color as stated in the document.
Enterprise WeChat screenshot_17186920882953
Enterprise WeChat screenshot_17186921122638

This problem was raised and fixed in 2019. Now the problem reappears in the new version and is not solved.

Current Behavior

When the color of itemStyle uses the callback function, the line color cannot change accordingly.

Expected Behavior

When the color of itemStyle uses the callback function, the line color can also change accordingly.

Environment

- OS: windows 10
-Browser:
- Framework:

Any additional comments?

No response

@Ovilia
Copy link
Contributor

Ovilia commented Jun 18, 2024

This does not appear to be a bug, in my opinion. When itemStyle.color is defined as a callback function, it has the capability to return different colors based on varying data indices. However, lineStyle.color does not support using different colors for different data indices. As a result, when it is specified as a callback, it defaults to the series color as a graceful fallback.

@Ovilia Ovilia added not-a-bug waiting-for: author topic: line and removed bug pending We are not sure about whether this is a bug/new feature. labels Jun 18, 2024
@never51463
Copy link
Author

This behavior does not match the document description, and the returned value belongs to a reasonable color range. It is unreasonable to assume that it is not a bug simply because it is returned using a callback function. Especially when the document explicitly states that lineStyle can inherit from itemStyle, this detail is illogical and independent of whether itemStyle uses callback function methods.
企业微信截图_17186941434179

@never51463
Copy link
Author

if it's no a bug, how to choose when I need to modify the color of a segment of a line based on different numerical values, but it is not a gradient scene? @Ovilia

@Ovilia
Copy link
Contributor

Ovilia commented Jun 18, 2024

Currently, ECharts doesn't have the ability to set line styles of different segments, if visualMap doesn't count.

@never51463
Copy link
Author

Perhaps adding support for callback function types to lineStyle would be more in line with the documentation's explanatory logic.
@Ovilia When there are multiple series, visualMap cannot support the simultaneous use of multiple configurations, and conflicts will be automatically merged.

@Ovilia
Copy link
Contributor

Ovilia commented Jun 19, 2024

#17138 Maybe you can follow this feature. This is an epic feature so it's still in pending state and I don't know if when I have time to do this.

@never51463
Copy link
Author

ok, i know that

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants