diff --git a/src/chart/sankey/SankeyView.ts b/src/chart/sankey/SankeyView.ts index 70b264d53e..e84b7f7ee8 100644 --- a/src/chart/sankey/SankeyView.ts +++ b/src/chart/sankey/SankeyView.ts @@ -259,13 +259,15 @@ class SankeyView extends ChartView { const dragX = itemModel.get('localX'); const dragY = itemModel.get('localY'); const emphasisModel = itemModel.getModel('emphasis'); + const borderRadius = itemModel.get(['itemStyle', 'borderRadius']) as number | number[] || 0; const rect = new graphic.Rect({ shape: { x: dragX != null ? dragX * width : layout.x, y: dragY != null ? dragY * height : layout.y, width: layout.dx, - height: layout.dy + height: layout.dy, + r: borderRadius }, style: itemModel.getModel('itemStyle').getItemStyle(), z2: 10 @@ -387,7 +389,7 @@ function createGridClipShape(rect: RectLike, seriesModel: SankeySeriesModel, cb: x: rect.x - 10, y: rect.y - 10, width: 0, - height: rect.height + 20 + height: rect.height + 20, } }); graphic.initProps(rectEl, { diff --git a/src/util/types.ts b/src/util/types.ts index 01e9321888..8fd9435013 100644 --- a/src/util/types.ts +++ b/src/util/types.ts @@ -925,6 +925,7 @@ export interface ItemStyleOption extends ShadowOptionMixin, B color?: ZRColor | (TCbParams extends never ? never : ((params: TCbParams) => ZRColor)) opacity?: number decal?: DecalObject | 'none' + borderRadius?: (number | string)[] | number | string } /** diff --git a/test/sankey-borderRadius.html b/test/sankey-borderRadius.html new file mode 100644 index 0000000000..8672578422 --- /dev/null +++ b/test/sankey-borderRadius.html @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +