Skip to content

Commit dca62c9

Browse files
committed
feat: support bar background borderRadius
1 parent 5667432 commit dca62c9

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

src/chart/bar/BarView.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ class BarView extends ChartView {
246246
if (coord.type === 'cartesian2d') {
247247
(bgEl as Rect).setShape('r', barBorderRadius);
248248
}
249+
else {
250+
(bgEl as Sector).setShape('cornerRadius', barBorderRadius);
251+
}
249252
bgEls[dataIndex] = bgEl;
250253
return bgEl;
251254
};
@@ -337,6 +340,9 @@ class BarView extends ChartView {
337340
if (coord.type === 'cartesian2d') {
338341
(bgEl as Rect).setShape('r', barBorderRadius);
339342
}
343+
else {
344+
(bgEl as Sector).setShape('cornerRadius', barBorderRadius);
345+
}
340346
bgEls[newIndex] = bgEl;
341347
}
342348
const bgLayout = getLayout[coord.type](data, newIndex);
@@ -990,15 +996,14 @@ function updateStyle(
990996
(el as Rect).setShape('r', borderRadius);
991997
}
992998
else if (!seriesModel.get('roundCap')) {
993-
const sector = el as Sector;
994999
const sectorShape = (el as Sector).shape;
9951000
const cornerRadius = getSectorCornerRadius(
9961001
itemModel.getModel('itemStyle'),
9971002
sectorShape,
9981003
true
9991004
);
10001005
extend(sectorShape, cornerRadius);
1001-
sector.setShape(sectorShape);
1006+
(el as Sector).setShape(sectorShape);
10021007
}
10031008

10041009
el.useStyle(style);

test/bar-polar-borderRadius.html

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)