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(pie/sunburst): fix borderRadius can't be reset in pie series and sunburst series when setting it to null or undefined #15243

Merged
merged 2 commits into from
Jul 2, 2021

Conversation

plainheart
Copy link
Member

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Fix the bug that borderRadius can't be reset in pie series and sunburst series when setting it to null.

Fixed issues

Details

Before: What was the problem?

borderRadius doesn't be removed when setting it to null or undefined.

After: How is it fixed in this PR?

Set borderRadius to 0 if it's null or undefined.

Misc

  • The API has been changed (apache/echarts-doc#xxx).
  • This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

NA.

Others

Merging options

  • Please squash the commits into a single one when merge.

Other information

…d sunburst series through `chart.setOption({ series: { itemStyle: { borderRadius: null } } })`, resolves #15242.
@echarts-bot
Copy link

echarts-bot bot commented Jun 25, 2021

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.

The pull request is marked to be PR: author is committer because you are a committer of this project.

) {
let cornerRadius = model.get('borderRadius');
if (cornerRadius == null) {
return null;
return zeroIfNull ? {innerCornerRadius: 0, cornerRadius: 0} : null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine to return { innerCornerRadius: 0, cornerRadius: 0 } directly. It will make this function simpler.

Copy link
Member Author

@plainheart plainheart Jul 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But that will make the other states incorrect. For example, we specify the borderRadius as 5 in the normal state, what expected should be also 5 in the emphasis state, but if we use directly { innerCornerRadius: 0, cornerRadius: 0 }, it will break this (reset to be 0). Thus using null is reasonable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I totally forgot that.

@pissang pissang merged commit 3ad3b5e into master Jul 2, 2021
@echarts-bot
Copy link

echarts-bot bot commented Jul 2, 2021

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

@pissang pissang deleted the fix/corner-radius-reset branch July 2, 2021 08:42
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.

None yet

2 participants