apache / echarts

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

fix(bar): fix borderColor hides bar color with large data #20465

Closed DevitX closed 1 week ago

DevitX commented 3 weeks ago

Brief Information

This pull request is in the type of:

What does this PR do?

Fixed issues

Details

Before: What was the problem?

borderColor in itemStyle overrides the color of Bar series on large data image image

After: How does it behave after the fixing?

reset color to default one. image image

Document Info

One of the following should be checked.

Misc

New Test Output

image

ZRender Changes

Related test cases or examples to use the new APIs

N.A.

Others

Merging options

Other information

echarts-bot[bot] commented 3 weeks ago

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.

DevitX commented 2 weeks ago

I'm not sure about if we should change like this. Is it expected to show fill color instead of stroke color in large scale bars? A reason to say NO for me is that the stoke width is a fixed width (etc. 1px) while the bar width is relatively quite small when in large scale bars, far less than 1px. So I would prefer to expect showing border color in this case.

Hi @Ovilia, thank you for your review! I believe that the expected behavior for a user is that: changing the border color should only affect the border even in large data, resulting in a bar with a distinct inner color and outer border. However in this case, since that is not possibile (like you said for very small width) with larger datasets, you end up with a single color and that can be quite messy. In this example: applying a black border: image

A possible solution might be to ignore user-defined colors at high data density, displaying the chart as if no borderColor is specified. This would revert to a simpler, default color scheme for clarity. And on zoom to less dense data, apply the correct property. What do you think about this? The default color is this: image

@nico-robert what behavior did you expect?

nico-robert commented 2 weeks ago

@nico-robert what behavior did you expect?

For me (personal opinion), the correct behavior is the result obtained with version 5.2.1, i.e. a border color that doesn't conflict with the color of the bar when the zoom is large and data is important. I don't know if it's difficult, but why not go back to the settings of version 5.2.1 ?

github-actions[bot] commented 2 weeks ago

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

echarts-bot[bot] commented 1 week ago

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