Rechart

From Asymmetric-al/core · View interactive version

Rechart is an AI agent skill from the GitHub repository Asymmetric-al/core. Build responsive, readable charts with Recharts using correct data mapping and composition. Use whenever creating charts with Recharts — LineChart, BarChart, AreaChart, PieChart, wrapped in ResponsiveContainer with a fixed-height parent. Not for charts built with other libraries.

How to use this skill

Skill file

Recharts in Core

Core pins Recharts 3 (recharts in packages/ui/package.json and the app manifests). Build charts with the shared shadcn chart wrapper in packages/ui/components/shadcn/chart.tsx; packages/ui/components/primitives/chart-wrappers.tsx adds ChartCard and KpiTile compositions.

Rules

Checklist

Example

See apps/admin/app/(app)/crm/giving-by-year-chart.tsx for a complete chart with next/dynamic, layout="fill", a formatted tooltip, and a table alternative.

import {
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
  type ChartConfig,
} from "@asym/ui/components/shadcn/chart";
import { Bar, BarChart, CartesianGrid, XAxis } from "recharts";

const config = {
  amount: { label: "Settled giving", color: "var(--chart-1)" },
} satisfies ChartConfig;

export function GivingBars({
  data,
}: {
  data: { label: string; amount: number }[];
}) {
  return (
    <ChartContainer config={config}>
      <BarChart data={data}>
        <CartesianGrid vertical={false} />
        <XAxis dataKey="label" tickLine={false} axisLine={false} />
        <ChartTooltip content={<ChartTooltipContent />} />
        <Bar
          dataKey="amount"
          fill="var(--color-amount)"
          radius={4}
          isAnimationActive={false}
        />
      </BarChart>
    </ChartContainer>
  );
}
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.