Skip to content

Commit

Permalink
Merge pull request #17715 from apache/fix-pie
Browse files Browse the repository at this point in the history
fix(pie): fix `labelLine` NPE when `minShowLabelRadian` is set
  • Loading branch information
Ovilia authored Sep 29, 2022
2 parents 213f7eb + 91382c2 commit 81321a6
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/chart/pie/labelLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,11 @@ export default function pieLabelLayout(

if (Math.abs(sectorShape.endAngle - sectorShape.startAngle) < minShowLabelRadian) {
each(label.states, setNotShow);
each(labelLine.states, setNotShow);
label.ignore = labelLine.ignore = true;
label.ignore = true;
if (labelLine) {
each(labelLine.states, setNotShow);
labelLine.ignore = true;
}
return;
}

Expand Down
35 changes: 35 additions & 0 deletions test/pie-label.html

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

0 comments on commit 81321a6

Please # to comment.