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

feat(pie/sunburst): supports configuring any one border radius. #16298

Merged
merged 6 commits into from
Jan 7, 2022

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?

Enhance the border radius for pie series & sunburst series to allow the developer to configure any one border radius instead of a pair.

Details

Before: What was the problem?

After: How is it fixed in this PR?

[5, 15, 0, 20] [20, 0, 0, 20]

Misc

Related test cases or examples to use the new APIs

Please refer to test/pie-cornerRadius.html.

Others

Merging options

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

Other information

@echarts-bot
Copy link

echarts-bot bot commented Dec 29, 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.

Document changes are required in this PR. Please also make a PR to apache/echarts-doc for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the PR: awaiting doc label.

This PR depends on ZRender changes. Please update the ZRender dependency to the latest nightly version including this change, which takes place everyday at 8:00 UTC (16:00 Beijing Time).
You can use npm i zrender@npm:zrender-nightly@dev to update package.json.
If you have any question about this, please leave a comment and we will give you extra help on this.

Ovilia
Ovilia previously approved these changes Dec 29, 2021
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.

LGTM

@pissang pissang added this to the 5.3 milestone Jan 4, 2022
@pissang
Copy link
Contributor

pissang commented Jan 4, 2022

@plainheart Do you mind adding user interactions record on the test?

@pissang
Copy link
Contributor

pissang commented Jan 4, 2022

Found some bad cases when clicking random data with inner radius 30%. Seems it happens when sector angle is small.

Chart width: 1000
Chart height: 400

@plainheart
Copy link
Member Author

plainheart commented Jan 6, 2022

It seems if the borderRadius doesn't get normalized in ECharts, the percentage value will become NaN during animation. It may be better to normalize this in ECharts instead of zrender... But zrender also needs this normalization...

To reproduce:

chart.setOption({
  series: [{
    itemStyle: {
      borderRadius: [0, 20, '50%']
    }
  }]
});

@pissang
Copy link
Contributor

pissang commented Jan 6, 2022

I think we can do percentage calculation in echarts and only support pixel value in zrender.

@plainheart
Copy link
Member Author

@pissang Yeah. I'm doing so.

@pissang
Copy link
Contributor

pissang commented Jan 7, 2022

@plainheart Please let me know if it's ready for next round review

@plainheart plainheart merged commit cf09ed9 into next Jan 7, 2022
@echarts-bot
Copy link

echarts-bot bot commented Jan 7, 2022

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

@plainheart plainheart deleted the enhance-pie-borderRadius branch January 7, 2022 08:38
@plainheart plainheart removed the PR: awaiting doc Document changes is required for this PR. label Jan 27, 2022
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

3 participants