Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sunburst): fix sunburst label may rotate when labelLayout.hideOverlap is enabled #18808

Merged
merged 1 commit into from
Jun 27, 2023
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
2 changes: 1 addition & 1 deletion src/chart/sunburst/SunburstPiece.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ class SunburstPiece extends graphic.Sector {
rotate = rotateType * Math.PI / 180;
}

state.rotation = rotate;
state.rotation = normalizeRadian(rotate);
});


Expand Down
3 changes: 3 additions & 0 deletions src/label/LabelManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import { PathStyleProps } from 'zrender/src/graphic/Path';
import Model from '../model/Model';
import { prepareLayoutList, hideOverlap, shiftLayoutOnX, shiftLayoutOnY } from './labelLayoutHelper';
import { labelInner, animateLabelValue } from './labelStyle';
import { normalizeRadian } from 'zrender/src/contain/util';

interface LabelDesc {
label: ZRText
Expand Down Expand Up @@ -219,6 +220,8 @@ class LabelManager {
dummyTransformable.scaleX = dummyTransformable.scaleY = 1;
}

dummyTransformable.rotation = normalizeRadian(dummyTransformable.rotation);

const host = label.__hostTarget;
let hostRect;
if (host) {
Expand Down
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/sunburst-label-rotate.json

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

110 changes: 110 additions & 0 deletions test/sunburst-label-rotate.html

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