Skip to content

Conversation

@susiwen8
Copy link
Contributor

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Fix barBorderRadius didn't work, not only background but also item

Fixed issues

Close #12321

Details

Screen Shot 2020-03-25 at 22 33 11

After: How is it fixed in this PR?

Screen Shot 2020-03-25 at 22 32 32

Usage

Are there any API changes?

  • The API has been changed.

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

@echarts-bot
Copy link

echarts-bot bot commented Mar 25, 2020

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.

width: width,
height: height
height: height,
r: seriesModel.get('barBorderRadius'),
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this should be itemModel.get('barBorderRadius')?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pissang item border radius wasn't set from here. so I have it removed.

x: layout.x + signX * fixedLineWidth / 2,
y: layout.y + signY * fixedLineWidth / 2,
r: layout.rb,
width: layout.width - signX * fixedLineWidth,
Copy link
Contributor

Choose a reason for hiding this comment

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

This layout is used for bar rect element. r property here will not be used.

x: isHorizontalOrRadial ? layout.x : coordLayout.x,
y: isHorizontalOrRadial ? coordLayout.y : layout.y,
r: isHorizontalOrRadial ? layout.r : coordLayout.r,
width: isHorizontalOrRadial ? layout.width : coordLayout.width,
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 should be layout.rb here. Also coordLayout is a rect. It don't have r property.

Also, I prefer not to put radius in the layout. See comment below.

height: height
height: height,
rb: seriesModel.get('backgroundStyle.barBorderRadius')
});
Copy link
Contributor

Choose a reason for hiding this comment

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

radius is not a layout related property. So I think it's better to set the property here.

https://github.com/apache/incubator-echarts/blob/b4b979a2fb9ad97493e7efb7c4d64055325ad214/src/chart/bar/BarView.js#L146

bgEl.setShape('r', backgroundModel.get('barBorderRadius'));

@pissang pissang merged commit fbe73ae into apache:master Mar 29, 2020
@echarts-bot
Copy link

echarts-bot bot commented Mar 29, 2020

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

@susiwen8 susiwen8 deleted the #12321 branch March 29, 2020 15:12
100pah added a commit that referenced this pull request Apr 2, 2020
The original PR is #12331
fbe73ae
This commit fixes: also update `r` when "update" rather than only in "add".
Add more test cases.
100pah added a commit that referenced this pull request Apr 2, 2020
The original PR is #12331
fbe73ae
This commit fixes: also update `r` when "update" rather than only in "add".
Add more test cases.
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.

Bar backgroundStyle barBorderRadius invalid

2 participants