Skip to content

Commit

Permalink
Merge pull request #14108 from Nick22nd/fix-13938
Browse files Browse the repository at this point in the history
fix(pie): pie chart avoidLabelOverlap hides label. close #13938
  • Loading branch information
pissang authored Jan 25, 2021
2 parents 5b4a211 + ab12807 commit 9f8340c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/chart/pie/labelLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ import { shiftLayoutOnY } from '../../label/labelLayoutHelper';
const RADIAN = Math.PI / 180;

interface LabelLayout {
label: ZRText,
labelLine: Polyline,
position: PieSeriesOption['label']['position'],
label: ZRText
labelLine: Polyline
position: PieSeriesOption['label']['position']
len: number
len2: number
minTurnAngle: number
maxSurfaceAngle: number
surfaceNormal: Point
linePoints: VectorArray[]
textAlign: HorizontalAlign
labelDistance: number,
labelAlignTo: PieSeriesOption['label']['alignTo'],
edgeDistance: number,
bleedMargin: PieSeriesOption['label']['bleedMargin'],
labelDistance: number
labelAlignTo: PieSeriesOption['label']['alignTo']
edgeDistance: number
bleedMargin: PieSeriesOption['label']['bleedMargin']
rect: BoundingRect
}

Expand Down Expand Up @@ -104,7 +104,7 @@ function adjustSingleSide(
// horizontal r is always same with original r because x is not changed.
const rA = r + item.len;
// Canculate rB based on the topest / bottemest label.
const rB = dx < rA
const rB = Math.abs(dx) < rA
? Math.sqrt(dy * dy / (1 - dx * dx / rA / rA))
: rA;
semi.rB = rB;
Expand Down Expand Up @@ -455,4 +455,4 @@ export default function pieLabelLayout(
}
}
}
}
}

0 comments on commit 9f8340c

Please sign in to comment.