Add y-offset

This commit is contained in:
Jared He 2022-07-06 19:55:29 -04:00
parent 52f346d3ce
commit 165c1d1061
2 changed files with 5 additions and 5 deletions

View File

@ -74,11 +74,11 @@ export function PieSlices({ isLabel, ...props }: PieSlicesProps<PieChartData>) {
/> />
<text <text
className={isLabel ? styles.labelText : styles.pieText} className={isLabel ? styles.labelText : styles.pieText}
x={centroidX} x={isLabel ? centroidX : centroidX}
y={centroidY} y={isLabel ? centroidY : centroidY + 10}
textAnchor="middle" textAnchor="middle"
> >
{isLabel ? `${arc.data.category}` : `${arc.data.value}%`} {isLabel ? `${arc.data.category}` : `${arc.data.value}%`}
</text> </text>
</g> </g>
); );

View File

@ -43,10 +43,10 @@ export const mockPieData = [
}, },
{ {
category: "Quail", category: "Quail",
value: 38, value: 48,
}, },
{ {
category: "Cuckoo", category: "Cuckoo",
value: 20, value: 10,
}, },
]; ];