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"
|
||||
|
||||
import React, { useMemo } from "react"
|
||||
import { Pie, PieChart } from "recharts"
|
||||
import { LabelList, Pie, PieChart } from "recharts"
|
||||
|
||||
import {
|
||||
Card,
|
||||
@ -71,7 +71,14 @@ export const CustomPieChart = React.memo(function CustomPieChart({
|
||||
dataKey="total"
|
||||
nameKey="name"
|
||||
label
|
||||
/>
|
||||
>
|
||||
<LabelList
|
||||
dataKey="name"
|
||||
className="fill-background font-medium"
|
||||
stroke="none"
|
||||
fontSize={12}
|
||||
/>
|
||||
</Pie>
|
||||
</PieChart>
|
||||
</ChartContainer>
|
||||
</CardContent>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user