Skip to content

Commit

Permalink
fix(labelLine): use right state name
Browse files Browse the repository at this point in the history
  • Loading branch information
susiwen8 committed Mar 24, 2022
1 parent d5e4469 commit b20ee70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions src/chart/pie/PieView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,20 +155,15 @@ class PiePiece extends graphic.Sector {
const labelLine = sector.getTextGuideLine();
const labelText = sector.getTextContent();

labelLine && extend(labelLine.ensureState('emphasis'), {
ignore: !emphasisModel.get(['labelLine', 'show'])
});

labelLine && extend(labelLine.ensureState('select'), {
x: dx,
y: dy,
ignore: !selectModel.get(['labelLine', 'show'])
y: dy
});
// TODO: needs dx, dy in zrender?
extend(labelText.ensureState('select'), {
x: dx,
y: dy,
ignore: !selectModel.get(['label', 'show'])
y: dy
});

toggleHoverEmphasis(
Expand Down
2 changes: 1 addition & 1 deletion src/label/labelGuideHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ export function setLabelLineStyle(
if (isLabelIgnored // Not show when label is not shown in this state.
|| !retrieve2(stateShow, showNormal) // Use normal state by default if not set.
) {
const stateObj = isNormal ? labelLine : (labelLine && labelLine.states.normal);
const stateObj = isNormal ? labelLine : (labelLine && labelLine.states[stateName]);
if (stateObj) {
stateObj.ignore = true;
}
Expand Down

0 comments on commit b20ee70

Please sign in to comment.