import { Bar, BarChart, CartesianGrid, XAxis, YAxis, LabelList, } from "recharts"; import { Card, CardContent } from "~/components/ui/card"; import { type ChartConfig, ChartContainer, } from "~/components/ui/chart"; export type CompanyChartDatum = { category: string; // related_company capacity: number; // percentage revenue: number; // percentage cost: number; // percentage }; const chartConfig = { capacity: { label: "افزایش ظرفیت", color: "#60A5FA", // Blue-400 }, revenue: { label: "افزایش درآمد", color: "#4ADE80", // Green-400 }, cost: { label: "کاهش هزینه", color: "#F87171", // Red-400 }, } satisfies ChartConfig; export function InteractiveBarChart({ data, }: { data: CompanyChartDatum[]; }) { return ( `${value}%`} /> `${Math.round(v)}%`} /> `${Math.round(v)}%`} /> `${Math.round(v)}%`} /> {/* Legend below chart */}
{chartConfig.capacity.label}
{chartConfig.cost.label}
{chartConfig.revenue.label}
); }