feat: add LabelList to pie chart to display category names
This commit is contained in:
parent
cb11ee9be6
commit
c1c87da623
@ -1,7 +1,7 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import React, { useMemo } from "react"
|
import React, { useMemo } from "react"
|
||||||
import { Pie, PieChart } from "recharts"
|
import { LabelList, Pie, PieChart } from "recharts"
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Card,
|
Card,
|
||||||
@ -71,7 +71,14 @@ export const CustomPieChart = React.memo(function CustomPieChart({
|
|||||||
dataKey="total"
|
dataKey="total"
|
||||||
nameKey="name"
|
nameKey="name"
|
||||||
label
|
label
|
||||||
/>
|
>
|
||||||
|
<LabelList
|
||||||
|
dataKey="name"
|
||||||
|
className="fill-background font-medium"
|
||||||
|
stroke="none"
|
||||||
|
fontSize={12}
|
||||||
|
/>
|
||||||
|
</Pie>
|
||||||
</PieChart>
|
</PieChart>
|
||||||
</ChartContainer>
|
</ChartContainer>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user