"use client"; import { CartesianGrid, Scatter, ScatterChart, XAxis, YAxis, ZAxis, } from "recharts"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, } from "@/components/ui/chart"; import { cn } from "@/lib/utils"; interface ChartCard24Props { title?: string; description?: string; className?: string; } const currencyFormatter = new Intl.NumberFormat("fa-IR", { style: "currency", currency: "IRR", minimumFractionDigits: 0, maximumFractionDigits: 0, }); const compactCurrencyFormatter = new Intl.NumberFormat("fa-IR", { style: "currency", currency: "IRR", notation: "compact", minimumFractionDigits: 0, maximumFractionDigits: 0, }); const numberFormatter = new Intl.NumberFormat("fa-IR", { maximumFractionDigits: 0, }); const dataA = [ { x: 100, y: 200, z: 200 }, { x: 120, y: 100, z: 260 }, { x: 170, y: 300, z: 400 }, { x: 140, y: 250, z: 280 }, { x: 150, y: 400, z: 500 }, { x: 110, y: 280, z: 200 }, ]; const dataB = [ { x: 200, y: 260, z: 240 }, { x: 240, y: 290, z: 220 }, { x: 190, y: 290, z: 250 }, { x: 198, y: 250, z: 210 }, { x: 180, y: 280, z: 260 }, { x: 210, y: 220, z: 230 }, ]; const chartConfig = { groupA: { label: "گروه الف", color: "var(--chart-1)", }, groupB: { label: "گروه ب", color: "var(--chart-2)", }, } satisfies ChartConfig; const ChartCard24 = ({ title = "بخش‌های بازار", description = "قیمت، حجم و درآمد به تفکیک بخش", className, }: ChartCard24Props) => { return ( {title} {description} currencyFormatter.format(Number(value)) } /> numberFormatter.format(Number(value))} /> { if (name === "x") { return `قیمت: ${currencyFormatter.format(Number(value))}`; } if (name === "y") { return `حجم: ${numberFormatter.format(Number(value))}`; } if (name === "z") { return `درآمد: ${compactCurrencyFormatter.format( Number(value) * 1000, )}`; } return `${name}: ${value}`; }} /> } /> } /> ); }; export { ChartCard24 };