Skip to content

Commit b59ade5

Browse files
feat(EmployeePaymentByMonthChart): add ChartLegend for improved data visualization
1 parent aec5423 commit b59ade5

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

resources/js/components/charts/employee-payment-by-month-chart.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
2-
import { ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent } from '@/components/ui/chart';
2+
import {
3+
ChartConfig,
4+
ChartContainer,
5+
ChartLegend,
6+
ChartLegendContent,
7+
ChartTooltip,
8+
ChartTooltipContent,
9+
} from '@/components/ui/chart';
310
import { formatCurrency } from '@/lib/utils';
411
import { EmployeePaymentsData } from '@/pages/dashboard/manager-dashboard';
512
import { useMemo } from 'react';
@@ -45,6 +52,10 @@ export default function EmployeePaymentByMonthChart({ chartData }: Readonly<{ ch
4552
/>
4653
<ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />
4754
<Bar dataKey="value" fill="var(--chart-4)" radius={8} />
55+
<ChartLegend
56+
content={<ChartLegendContent nameKey="value" />}
57+
className="flex-wrap gap-2 *:basis-1/4 *:justify-center"
58+
/>
4859
</BarChart>
4960
</ChartContainer>
5061
</CardContent>

0 commit comments

Comments
 (0)