diff --git a/src/chart/pie/PieSeries.ts b/src/chart/pie/PieSeries.ts index 0521d00e50..99fdbdff6b 100644 --- a/src/chart/pie/PieSeries.ts +++ b/src/chart/pie/PieSeries.ts @@ -68,7 +68,7 @@ export interface PieStateOption { labelLine?: PieLabelLineOption } interface PieLabelOption extends Omit { - rotate?: number | boolean | 'radial' | 'tangential' + rotate?: number | boolean | 'radial' | 'tangential' | 'tangential-fixed' alignTo?: 'none' | 'labelLine' | 'edge' edgeDistance?: string | number /** diff --git a/src/chart/pie/labelLayout.ts b/src/chart/pie/labelLayout.ts index b99d118577..5ea2ce031e 100644 --- a/src/chart/pie/labelLayout.ts +++ b/src/chart/pie/labelLayout.ts @@ -484,7 +484,7 @@ export default function pieLabelLayout( const radialAngle = nx < 0 ? -midAngle + PI : -midAngle; labelRotate = radialAngle; } - else if (rotate === 'tangential' + else if (rotate === 'tangential' || rotate === 'tangential-fixed' && labelPosition !== 'outside' && labelPosition !== 'outer' ) { let rad = Math.atan2(nx, ny); @@ -492,7 +492,7 @@ export default function pieLabelLayout( rad = PI * 2 + rad; } const isDown = ny > 0; - if (isDown) { + if (isDown && rotate !== 'tangential-fixed') { rad = PI + rad; } labelRotate = rad - PI; diff --git a/test/pie-label-rotate.html b/test/pie-label-rotate.html index 91ecea316a..5c4b47374c 100644 --- a/test/pie-label-rotate.html +++ b/test/pie-label-rotate.html @@ -39,7 +39,8 @@

Pie series label rotate