Add y-offset
This commit is contained in:
parent
52f346d3ce
commit
165c1d1061
|
@ -74,11 +74,11 @@ 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}%`}
|
||||
{isLabel ? `${arc.data.category}` : `${arc.data.value}%`}
|
||||
</text>
|
||||
</g>
|
||||
);
|
||||
|
|
|
@ -43,10 +43,10 @@ export const mockPieData = [
|
|||
},
|
||||
{
|
||||
category: "Quail",
|
||||
value: 38,
|
||||
value: 48,
|
||||
},
|
||||
{
|
||||
category: "Cuckoo",
|
||||
value: 20,
|
||||
value: 10,
|
||||
},
|
||||
];
|
||||
|
|
Loading…
Reference in New Issue