diff --git a/src/chart/sunburst/SunburstPiece.ts b/src/chart/sunburst/SunburstPiece.ts index 91ac0f4559..6bd8f597e7 100644 --- a/src/chart/sunburst/SunburstPiece.ts +++ b/src/chart/sunburst/SunburstPiece.ts @@ -32,6 +32,7 @@ import { getSectorCornerRadius } from '../helper/pieHelper'; import {createOrUpdatePatternFromDecal} from '../../util/decal'; import ExtensionAPI from '../../core/ExtensionAPI'; import { saveOldStyle } from '../../animation/basicTransition'; +import { normalizeRadian } from 'zrender/src/contain/util'; const DEFAULT_SECTOR_Z = 2; const DEFAULT_TEXT_Z = 4; @@ -251,8 +252,8 @@ class SunburstPiece extends graphic.Sector { const rotateType = getLabelAttr(labelStateModel, 'rotate'); let rotate = 0; if (rotateType === 'radial') { - rotate = -midAngle; - if (rotate < -Math.PI / 2) { + rotate = normalizeRadian(-midAngle); + if (((rotate > Math.PI / 2 && rotate <= Math.PI * 1.5))) { rotate += Math.PI; } } diff --git a/test/sunburst-label.html b/test/sunburst-label.html index f7b7c2cf87..51f2c14ef1 100644 --- a/test/sunburst-label.html +++ b/test/sunburst-label.html @@ -28,6 +28,7 @@ + @@ -37,6 +38,7 @@ +
@@ -112,6 +114,124 @@ }); + +