Skip to content
Merged
Show file tree
Hide file tree
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: 3 additions & 11 deletions src/chart/bar/BarView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
});

Expand Down Expand Up @@ -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;
}
};
Expand Down
10 changes: 9 additions & 1 deletion src/layout/barPolar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
});

}
Expand Down
81 changes: 0 additions & 81 deletions test/bar-polar-basic.html

This file was deleted.

106 changes: 106 additions & 0 deletions test/bar-polar-clockwise.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions test/runTest/actions/__meta__.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions test/runTest/actions/bar-polar-clockwise.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.