"use client"; import { Bar, BarChart, Pie, PieChart, XAxis, YAxis } from "recharts"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { type ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent, } from "@/components/ui/chart"; import { cn } from "@/lib/utils"; interface ChartGroup6Props { className?: string; } const numberFormatter = new Intl.NumberFormat("fa-IR", { maximumFractionDigits: 0, }); const compactNumberFormatter = new Intl.NumberFormat("fa-IR", { notation: "compact", maximumFractionDigits: 1, }); const pieData = [ { name: "دسکتاپ", value: 4520, fill: "var(--chart-1)" }, { name: "موبایل", value: 3210, fill: "var(--chart-2)" }, { name: "تبلت", value: 1270, fill: "var(--chart-3)" }, ]; const pieConfig = { دسکتاپ: { label: "دسکتاپ", color: "var(--chart-1)" }, موبایل: { label: "موبایل", color: "var(--chart-2)" }, تبلت: { label: "تبلت", color: "var(--chart-3)" }, } satisfies ChartConfig; const barData = [ { name: "Chrome", value: 4200 }, { name: "Safari", value: 2800 }, { name: "Firefox", value: 1400 }, { name: "Edge", value: 980 }, { name: "سایر", value: 620 }, ]; const barConfig = { value: { label: "کاربران", color: "var(--chart-4)" }, } satisfies ChartConfig; const ChartGroup6 = ({ className }: ChartGroup6Props) => { const total = pieData.reduce((sum, item) => sum + item.value, 0); return (
ترافیک به تفکیک دستگاه تفکیک نشست‌های کاربر
numberFormatter.format(Number(value)) } /> } cursor={false} />
{numberFormatter.format(total)} مجموع
{pieData.map((item, index) => (
{item.name}
{numberFormatter.format(item.value)}
))}
استفاده از مرورگر برترین مرورگرها بر اساس کاربر compactNumberFormatter.format(Number(v)) } /> numberFormatter.format(Number(value)) } /> } cursor={{ fillOpacity: 0.05 }} />
); }; export { ChartGroup6 };