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

View File

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