mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 06:57:47 +01:00
fix(frontend): Fixed type error
This commit is contained in:
@@ -16,7 +16,7 @@ function SinglePieChart({ data, title }: { data: { name: string; value: number }
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
return (
|
||||
<div style={{ flex: 1 }}>
|
||||
<h4>{title}</h4>
|
||||
<ResponsiveContainer width="100%" height={300}>
|
||||
@@ -30,9 +30,9 @@ function SinglePieChart({ data, title }: { data: { name: string; value: number }
|
||||
fill="#8884d8"
|
||||
dataKey="value"
|
||||
nameKey="name"
|
||||
label={({ name, percent }) => `${name} ${(percent * 100).toFixed(0)}%`}
|
||||
label={(props: any) => `${props.name} ${(props.percent * 100).toFixed(0)}%`}
|
||||
>
|
||||
{data.map((entry, index) => (
|
||||
{data.map((_entry, index) => (
|
||||
<Cell key={`cell-${index}`} fill={COLORS[index % COLORS.length]} />
|
||||
))}
|
||||
</Pie>
|
||||
|
||||
Reference in New Issue
Block a user