diff --git a/src/chart/bar/BarView.ts b/src/chart/bar/BarView.ts index e4be916699..dce754a46c 100644 --- a/src/chart/bar/BarView.ts +++ b/src/chart/bar/BarView.ts @@ -746,18 +746,9 @@ const elementCreator: { seriesModel, data, newIndex, layout: SectorLayout, isRadial: boolean, animationModel, axisModel, isUpdate, roundCap ) { - // Keep the same logic with bar in catesion: use end value to control - // direction. Notice that if clockwise is true (by default), the sector - // will always draw clockwisely, no matter whether endAngle is greater - // or less than startAngle. - const clockwise = layout.startAngle < layout.endAngle; - const ShapeClass = (!isRadial && roundCap) ? Sausage : Sector; - const sector = new ShapeClass({ - shape: defaults({ - clockwise: clockwise - }, layout), + shape: layout, z2: 1 }); @@ -909,7 +900,8 @@ const getLayout: { r0: layout.r0, r: layout.r, startAngle: layout.startAngle, - endAngle: layout.endAngle + endAngle: layout.endAngle, + clockwise: layout.clockwise } as SectorLayout; } }; diff --git a/src/layout/barPolar.ts b/src/layout/barPolar.ts index 081d884634..bc63fcba99 100644 --- a/src/layout/barPolar.ts +++ b/src/layout/barPolar.ts @@ -183,7 +183,15 @@ function barLayoutPolar(seriesType: string, ecModel: GlobalModel, api: Extension // Consider that positive angle is anti-clockwise, // while positive radian of sector is clockwise startAngle: -startAngle * Math.PI / 180, - endAngle: -endAngle * Math.PI / 180 + endAngle: -endAngle * Math.PI / 180, + + /** + * Keep the same logic with bar in catesion: use end value to + * control direction. Notice that if clockwise is true (by + * default), the sector will always draw clockwisely, no matter + * whether endAngle is greater or less than startAngle. + */ + clockwise: startAngle >= endAngle }); } diff --git a/test/bar-polar-basic.html b/test/bar-polar-basic.html deleted file mode 100644 index 3dab721de3..0000000000 --- a/test/bar-polar-basic.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - -
- - - - - - - -