/* eslint-disable @typescript-eslint/no-explicit-any */ import { Box } from "@mui/material"; import { PieChart, Pie, Cell, ResponsiveContainer } from "recharts"; import "./PieCharts.scss"; interface IPieChartData { name: string; value: number; } interface IPieChartsProps { data?: IPieChartData[]; } const COLORS = ["#4caf50", "#ff9800", "#f44336", "#9e9e9e"]; const defaultData: IPieChartData[] = [ { name: "Group A", value: 100 }, { name: "Group B", value: 200 }, { name: "Group C", value: 400 }, { name: "Group D", value: 300 }, ]; const RADIAN = Math.PI / 180; const renderCustomizedLabel = ({ cx, cy, midAngle, innerRadius, outerRadius, percent, // index }: any) => { const radius = innerRadius + (outerRadius - innerRadius) * 0.5; const x = cx + radius * Math.cos(-midAngle * RADIAN); const y = cy + radius * Math.sin(-midAngle * RADIAN); return ( cx ? "start" : "end"} dominantBaseline="central" > {`${(percent * 100).toFixed(0)}%`} ); }; export default function PieCharts({ data = defaultData }: IPieChartsProps) { return ( {data.map((entry, index) => ( ))} ); }