"use client"; import { PolarAngleAxis, RadialBar, RadialBarChart } 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 ChartCard19Props { title?: string; description?: string; className?: string; } const percentFormatter = new Intl.NumberFormat("fa-IR", { maximumFractionDigits: 0, }); const chartData = [ { name: "Chrome", value: 45, fill: "var(--chart-1)" }, { name: "Safari", value: 28, fill: "var(--chart-2)" }, { name: "Firefox", value: 15, fill: "var(--chart-3)" }, { name: "Edge", value: 8, fill: "var(--chart-4)" }, { name: "سایر", value: 4, fill: "var(--chart-5)" }, ]; const chartConfig = { Chrome: { label: "Chrome", color: "var(--chart-1)" }, Safari: { label: "Safari", color: "var(--chart-2)" }, Firefox: { label: "Firefox", color: "var(--chart-3)" }, Edge: { label: "Edge", color: "var(--chart-4)" }, سایر: { label: "سایر", color: "var(--chart-5)" }, } satisfies ChartConfig; const ChartCard19 = ({ title = "سهم مرورگرها", description = "ترافیک به تفکیک نوع مرورگر", className, }: ChartCard19Props) => { return ( {title} {description}
( {chartConfig[name as keyof typeof chartConfig]?.label ?? name} : {percentFormatter.format(Number(value))}٪ )} /> } />
{chartData.map((item) => (
{item.name} {percentFormatter.format(item.value)}٪
))}
); }; export { ChartCard19 };