Skip to content

Add barRadiusX and barRadiusY props to BarSeries #1188

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/plot/series/bar-series.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,17 @@ class BarSeries extends AbstractSeries {
lineSizeAttr: PropTypes.string,
valueSizeAttr: PropTypes.string,
cluster: PropTypes.string,
barWidth: PropTypes.number
barWidth: PropTypes.number,
barRadiusX: PropTypes.number,
barRadiusY: PropTypes.number
};
}

static get defaultProps() {
return {
barWidth: 0.85
barWidth: 0.85,
barRadiusX: 0,
barRadiusY: 0
};
}

Expand All @@ -60,7 +64,9 @@ class BarSeries extends AbstractSeries {
style,
valuePosAttr,
valueSizeAttr,
barWidth
barWidth,
barRadiusX,
barRadiusY
} = this.props;

if (!data) {
Expand Down Expand Up @@ -120,6 +126,8 @@ class BarSeries extends AbstractSeries {
[lineSizeAttr]: spacePerBar,
[valuePosAttr]: Math.min(value0Functor(d), valueFunctor(d)),
[valueSizeAttr]: Math.abs(-value0Functor(d) + valueFunctor(d)),
rx: barRadiusX,
ry: barRadiusY,
onClick: e => this._valueClickHandler(d, e),
onContextMenu: e => this._valueRightClickHandler(d, e),
onMouseOver: e => this._valueMouseOverHandler(d, e),
Expand Down