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

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

Merged
merged 10 commits into from
Nov 14, 2024

Conversation

DevitX
Copy link
Contributor

@DevitX DevitX commented Oct 30, 2024

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

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.

  • 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

New Test Output

image

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

Copy link

echarts-bot bot commented Oct 30, 2024

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'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.

@DevitX
Copy link
Contributor Author

DevitX commented Nov 1, 2024

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
Copy link

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

src/chart/bar/BarView.ts Show resolved Hide resolved
@pull-request-size pull-request-size bot added size/L and removed size/XS labels Nov 6, 2024
@pull-request-size pull-request-size bot added size/XS and removed size/L labels Nov 6, 2024
@DevitX DevitX requested a review from Ovilia November 6, 2024 19:48
Copy link
Contributor

github-actions bot commented Nov 7, 2024

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

@Ovilia Ovilia added this to the 5.5.2 milestone Nov 13, 2024
@Ovilia Ovilia merged commit 25d9570 into apache:master Nov 14, 2024
2 checks passed
Copy link

echarts-bot bot commented Nov 14, 2024

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

@DevitX DevitX deleted the fix-18185 branch November 14, 2024 09:24
@plainheart plainheart changed the title fix(BarView): borderColor hides bar color with large data. close #18185 fix(bar): fix borderColor hides bar color with large data Nov 15, 2024
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.

3 participants