[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6QQ49TN9ZXVBRARB4Q97P1M":3,"skill-same:01M6QQ49TN9ZXVBRARB4Q97P1M":71},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":6,"ownerHtmlUrl":49,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":50,"install":51,"resources":64},"01M6QQ49TN9ZXVBRARB4Q97P1M","charts",null,"Charts and data visualization with Recharts — bar, line, area, pie\u002Fdonut, scatter, and composed\u002Fradar\u002Fradial variants. Plus reference lines\u002Fareas (targets, thresholds), brush (zoom), synced charts, click drill-down, custom theme-aware tooltips, sparklines in stat cards, axis formatters (currency\u002Fpercentages\u002Fdates), responsive sizing, accessibility. Use whenever the user wants graphs, charts, dashboards, analytics, KPIs, trends, or any visual representation of numeric or temporal data.","SimaDevelopment\u002Fopsiforce","SimaDevelopment","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F153810655?v=4","01M6QQ054MKBDSS43AND3FNHDK","Opsima","01M6QQ058VFT6EY7HCBVN49G8Z",43,"AGPL-3.0","https:\u002F\u002Fgithub.com\u002FSimaDevelopment\u002Fopsiforce\u002Fblob\u002Fmain\u002Fagent-config\u002Fagents\u002Fapp-builder\u002Fskills\u002Fcharts\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"Charts","currency","variants","down","custom","sparklines","recharts","theme","thresholds","line","drill","analytics","click","responsive","radar","use","dashboards","data","visualization","data visualization","2026-11-10 10:12:30",false,"---\nname: charts\ndescription: Charts and data visualization with Recharts — bar, line, area, pie\u002Fdonut, scatter, and composed\u002Fradar\u002Fradial variants. Plus reference lines\u002Fareas (targets, thresholds), brush (zoom), synced charts, click drill-down, custom theme-aware tooltips, sparklines in stat cards, axis formatters (currency\u002Fpercentages\u002Fdates), responsive sizing, accessibility. Use whenever the user wants graphs, charts, dashboards, analytics, KPIs, trends, or any visual representation of numeric or temporal data.\n---\n\n# Charts (Recharts)\n\nRecharts is preinstalled. Composable React + D3 charts. Charts are built by nesting components inside one of `LineChart`, `BarChart`, `AreaChart`, `PieChart`, `ScatterChart`, `RadarChart`, `RadialBarChart`, or `ComposedChart`.\n\n## Project rules\n\n- **Always wrap charts in `\u003CResponsiveContainer width=\"100%\" height={N}>`** — without it the chart renders at 0px height. The parent must have a defined width; height must be a number, not a percentage.\n- **Always use theme tokens** for colors: `var(--chart-1)` through `var(--chart-5)`. Never hardcode hex values — they break dark mode and look generic.\n- **Always render a custom tooltip** so it matches the app's card\u002Fborder styling (default tooltip is white-on-white in dark mode).\n- **Always handle empty data** — render a skeleton or empty state when `data.length === 0`. An empty chart shows axes and confuses users.\n\n## Data shape\n\nRecharts expects an array of objects. Each object is one data point; each numeric property can be plotted as a series.\n\n```ts\nconst data = [\n  { month: \"Jan\", revenue: 4000, expenses: 2400 },\n  { month: \"Feb\", revenue: 3000, expenses: 1398 },\n  { month: \"Mar\", revenue: 2000, expenses: 9800 },\n]\n```\n\n`dataKey` props map object properties to chart components: `dataKey=\"revenue\"`, or `dataKey={(entry) => entry.revenue - entry.expenses}` for derived values (memoize the function with `useCallback` — see references\u002Fadvanced.md).\n\n## Bar chart\n\n```tsx\nimport { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer } from \"recharts\"\n\n\u003CResponsiveContainer width=\"100%\" height={300}>\n  \u003CBarChart data={data}>\n    \u003CCartesianGrid strokeDasharray=\"3 3\" className=\"stroke-border\" \u002F>\n    \u003CXAxis dataKey=\"month\" className=\"text-xs fill-muted-foreground\" \u002F>\n    \u003CYAxis className=\"text-xs fill-muted-foreground\" \u002F>\n    \u003CTooltip content={\u003CChartTooltip \u002F>} \u002F>\n    \u003CLegend \u002F>\n    \u003CBar dataKey=\"revenue\" fill=\"var(--chart-1)\" radius={[4, 4, 0, 0]} \u002F>\n    \u003CBar dataKey=\"expenses\" fill=\"var(--chart-2)\" radius={[4, 4, 0, 0]} \u002F>\n  \u003C\u002FBarChart>\n\u003C\u002FResponsiveContainer>\n```\n\n**Stacked bars** — share a `stackId`, only the top bar gets `radius`:\n\n```tsx\n\u003CBar dataKey=\"completed\" stackId=\"a\" fill=\"var(--chart-1)\" \u002F>\n\u003CBar dataKey=\"pending\" stackId=\"a\" fill=\"var(--chart-2)\" radius={[4, 4, 0, 0]} \u002F>\n```\n\n**Horizontal bar** — flip layout and swap axis types:\n\n```tsx\n\u003CBarChart layout=\"vertical\" data={data}>\n  \u003CXAxis type=\"number\" \u002F>\n  \u003CYAxis type=\"category\" dataKey=\"name\" \u002F>\n  \u003CBar dataKey=\"value\" fill=\"var(--chart-1)\" \u002F>\n\u003C\u002FBarChart>\n```\n\n## Line chart\n\n```tsx\nimport { LineChart, Line } from \"recharts\"\n\n\u003CResponsiveContainer width=\"100%\" height={300}>\n  \u003CLineChart data={data}>\n    \u003CCartesianGrid strokeDasharray=\"3 3\" className=\"stroke-border\" \u002F>\n    \u003CXAxis dataKey=\"month\" className=\"text-xs fill-muted-foreground\" \u002F>\n    \u003CYAxis className=\"text-xs fill-muted-foreground\" \u002F>\n    \u003CTooltip content={\u003CChartTooltip \u002F>} \u002F>\n    \u003CLine type=\"monotone\" dataKey=\"value\" stroke=\"var(--chart-1)\" strokeWidth={2} dot={false} \u002F>\n    \u003CLine type=\"monotone\" dataKey=\"target\" stroke=\"var(--chart-2)\" strokeWidth={2} strokeDasharray=\"5 5\" \u002F>\n  \u003C\u002FLineChart>\n\u003C\u002FResponsiveContainer>\n```\n\n`type` options: `\"monotone\"` (smooth, default for trend data), `\"linear\"`, `\"step\"`, `\"natural\"`. Set `dot={false}` for dense series, `connectNulls` to bridge gaps.\n\n## Area chart\n\n```tsx\nimport { AreaChart, Area } from \"recharts\"\n\n\u003CResponsiveContainer width=\"100%\" height={300}>\n  \u003CAreaChart data={data}>\n    \u003CCartesianGrid strokeDasharray=\"3 3\" className=\"stroke-border\" \u002F>\n    \u003CXAxis dataKey=\"month\" className=\"text-xs fill-muted-foreground\" \u002F>\n    \u003CYAxis className=\"text-xs fill-muted-foreground\" \u002F>\n    \u003CTooltip content={\u003CChartTooltip \u002F>} \u002F>\n    \u003CArea type=\"monotone\" dataKey=\"value\" stroke=\"var(--chart-1)\" fill=\"var(--chart-1)\" fillOpacity={0.2} \u002F>\n  \u003C\u002FAreaChart>\n\u003C\u002FResponsiveContainer>\n```\n\n**Stacked areas** — share a `stackId`:\n\n```tsx\n\u003CArea type=\"monotone\" dataKey=\"ios\" stackId=\"1\" stroke=\"var(--chart-1)\" fill=\"var(--chart-1)\" fillOpacity={0.4} \u002F>\n\u003CArea type=\"monotone\" dataKey=\"android\" stackId=\"1\" stroke=\"var(--chart-2)\" fill=\"var(--chart-2)\" fillOpacity={0.4} \u002F>\n```\n\n**Gradient fill** — define once in `\u003Cdefs>`, reference by URL:\n\n```tsx\n\u003CAreaChart data={data}>\n  \u003Cdefs>\n    \u003ClinearGradient id=\"fillValue\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n      \u003Cstop offset=\"5%\" stopColor=\"var(--chart-1)\" stopOpacity={0.6} \u002F>\n      \u003Cstop offset=\"95%\" stopColor=\"var(--chart-1)\" stopOpacity={0} \u002F>\n    \u003C\u002FlinearGradient>\n  \u003C\u002Fdefs>\n  \u003CArea type=\"monotone\" dataKey=\"value\" stroke=\"var(--chart-1)\" fill=\"url(#fillValue)\" \u002F>\n\u003C\u002FAreaChart>\n```\n\n## Pie \u002F donut chart\n\n```tsx\nimport { PieChart, Pie, Cell } from \"recharts\"\n\nconst COLORS = [\n  \"var(--chart-1)\",\n  \"var(--chart-2)\",\n  \"var(--chart-3)\",\n  \"var(--chart-4)\",\n  \"var(--chart-5)\",\n]\n\n\u003CResponsiveContainer width=\"100%\" height={300}>\n  \u003CPieChart>\n    \u003CPie\n      data={data}\n      dataKey=\"value\"\n      nameKey=\"name\"\n      cx=\"50%\"\n      cy=\"50%\"\n      innerRadius={60}\n      outerRadius={100}\n      paddingAngle={2}\n      label={({ name, percent }) => `${name} ${(percent * 100).toFixed(0)}%`}\n    >\n      {data.map((_, i) => \u003CCell key={i} fill={COLORS[i % COLORS.length]} \u002F>)}\n    \u003C\u002FPie>\n    \u003CTooltip content={\u003CChartTooltip \u002F>} \u002F>\n    \u003CLegend \u002F>\n  \u003C\u002FPieChart>\n\u003C\u002FResponsiveContainer>\n```\n\n`innerRadius={0}` for a solid pie, `> 0` for a donut. `Cell` will be replaced by the `shape` prop in Recharts 4 — `Cell` still works today, plan to migrate when 4 ships.\n\n## Scatter chart\n\n```tsx\nimport { ScatterChart, Scatter } from \"recharts\"\n\n\u003CResponsiveContainer width=\"100%\" height={300}>\n  \u003CScatterChart>\n    \u003CCartesianGrid strokeDasharray=\"3 3\" className=\"stroke-border\" \u002F>\n    \u003CXAxis type=\"number\" dataKey=\"x\" name=\"Weight\" className=\"text-xs fill-muted-foreground\" \u002F>\n    \u003CYAxis type=\"number\" dataKey=\"y\" name=\"Height\" className=\"text-xs fill-muted-foreground\" \u002F>\n    \u003CTooltip cursor={{ strokeDasharray: \"3 3\" }} content={\u003CChartTooltip \u002F>} \u002F>\n    \u003CScatter name=\"Sample A\" data={data} fill=\"var(--chart-1)\" \u002F>\n  \u003C\u002FScatterChart>\n\u003C\u002FResponsiveContainer>\n```\n\nFor bubble charts, add `\u003CZAxis dataKey=\"size\" range={[60, 400]} \u002F>` and the scatter dots scale with the third dimension.\n\n## Reference lines and areas\n\nFor targets, thresholds, and goal markers:\n\n```tsx\nimport { ReferenceLine, ReferenceArea } from \"recharts\"\n\n\u003CLineChart data={data}>\n  {\u002F* ... axes, lines *\u002F}\n  \u003CReferenceLine y={5000} label=\"Target\" stroke=\"var(--chart-3)\" strokeDasharray=\"3 3\" \u002F>\n  \u003CReferenceArea x1=\"Jan\" x2=\"Mar\" fill=\"var(--chart-2)\" fillOpacity={0.1} label=\"Q1\" \u002F>\n\u003C\u002FLineChart>\n```\n\nFor live\u002Fstreaming data, many-chart dashboards, or radar\u002Fradial\u002Fcomposed\u002Fsynced\u002Fbrush charts, Read references\u002Fadvanced.md.\n\n## Click and hover events\n\n```tsx\n\u003CBarChart onClick={(state) => console.log(\"chart click\", state)}>\n  \u003CBar\n    dataKey=\"sales\"\n    fill=\"var(--chart-1)\"\n    onClick={(payload, index) => navigate(`\u002Fitems\u002F${payload.id}`)}\n  \u002F>\n\u003C\u002FBarChart>\n```\n\n`Tooltip` has interaction props for click-to-pin or controlled selection:\n\n```tsx\n\u003CTooltip trigger=\"click\" defaultIndex={0} cursor={false} content={\u003CChartTooltip \u002F>} \u002F>\n```\n\n## Theme-aware custom tooltip\n\n```tsx\nimport type { TooltipProps } from \"recharts\"\n\ninterface TooltipPayloadEntry {\n  name: string\n  value: number\n  color: string\n}\n\nfunction ChartTooltip({ active, payload, label }: TooltipProps\u003Cnumber, string>) {\n  if (!active || !payload?.length) return null\n  return (\n    \u003Cdiv className=\"rounded-lg border bg-card p-3 shadow-md\">\n      \u003Cp className=\"text-sm font-medium mb-1\">{label}\u003C\u002Fp>\n      {payload.map((entry, i) => (\n        \u003Cdiv key={i} className=\"flex items-center gap-2 text-sm\">\n          \u003Cspan className=\"h-2.5 w-2.5 rounded-full\" style={{ backgroundColor: entry.color }} \u002F>\n          \u003Cspan className=\"text-muted-foreground\">{entry.name}:\u003C\u002Fspan>\n          \u003Cspan className=\"font-medium\">{entry.value?.toLocaleString()}\u003C\u002Fspan>\n        \u003C\u002Fdiv>\n      ))}\n    \u003C\u002Fdiv>\n  )\n}\n```\n\nUse on every chart: `\u003CTooltip content={\u003CChartTooltip \u002F>} \u002F>`.\n\n## Axis formatting\n\n```tsx\n\u002F\u002F Currency\n\u003CYAxis tickFormatter={(v) => `$${(v \u002F 1000).toFixed(0)}k`} \u002F>\n\n\u002F\u002F Locale-aware numbers\n\u003CYAxis tickFormatter={(v) => v.toLocaleString()} \u002F>\n\n\u002F\u002F Percentages\n\u003CYAxis tickFormatter={(v) => `${v}%`} domain={[0, 100]} \u002F>\n\n\u002F\u002F Dates with date-fns\nimport { format, parseISO } from \"date-fns\"\n\u003CXAxis dataKey=\"date\" tickFormatter={(v) => format(parseISO(v), \"MMM d\")} \u002F>\n\n\u002F\u002F Rotate when labels overlap\n\u003CXAxis dataKey=\"month\" angle={-45} textAnchor=\"end\" height={60} \u002F>\n\n\u002F\u002F Force every label or auto-thin\n\u003CXAxis interval={0} \u002F>               \u002F\u002F show every label (clip overlapping)\n\u003CXAxis interval=\"preserveStartEnd\" \u002F> \u002F\u002F auto-decide, keep first + last\n```\n\n## Custom domains\n\n```tsx\n\u003CYAxis domain={[0, 100]} \u002F>                              \u002F\u002F fixed range\n\u003CYAxis domain={[0, \"auto\"]} \u002F>                           \u002F\u002F auto upper\n\u003CYAxis domain={[0, \"dataMax + 100\"]} allowDataOverflow \u002F> \u002F\u002F padded\n\u003CYAxis type=\"number\" scale=\"log\" domain={[\"auto\", \"auto\"]} \u002F> \u002F\u002F log scale\n```\n\n## Sparkline + stat card\n\nProject pattern for KPI tiles:\n\n```tsx\nfunction StatCard({ title, value, trend, data }: {\n  title: string\n  value: string\n  trend: string\n  data: { v: number }[]\n}) {\n  return (\n    \u003CCard>\n      \u003CCardContent className=\"p-4\">\n        \u003Cp className=\"text-sm text-muted-foreground\">{title}\u003C\u002Fp>\n        \u003Cp className=\"text-2xl font-bold\">{value}\u003C\u002Fp>\n        \u003Cp className=\"text-xs text-muted-foreground\">{trend}\u003C\u002Fp>\n        \u003CResponsiveContainer width=\"100%\" height={40}>\n          \u003CAreaChart data={data}>\n            \u003CArea\n              type=\"monotone\"\n              dataKey=\"v\"\n              stroke=\"var(--chart-1)\"\n              fill=\"var(--chart-1)\"\n              fillOpacity={0.1}\n              strokeWidth={1.5}\n            \u002F>\n          \u003C\u002FAreaChart>\n        \u003C\u002FResponsiveContainer>\n      \u003C\u002FCardContent>\n    \u003C\u002FCard>\n  )\n}\n```\n\nNo axes, no tooltip, no grid — just the trend.\n\n## Accessibility\n\n`accessibilityLayer` is on by default (keyboard navigable, screen-reader compatible). Always add an aria-label that describes what the chart shows:\n\n```tsx\n\u003CLineChart data={data} role=\"img\" aria-label=\"Monthly revenue, January through June 2026\">\n  {\u002F* ... *\u002F}\n\u003C\u002FLineChart>\n```\n\n## Empty \u002F loading states\n\n```tsx\nif (isPending) return \u003CSkeleton className=\"h-[300px] w-full\" \u002F>\nif (!data.length) {\n  return (\n    \u003Cdiv className=\"flex h-[300px] items-center justify-center text-sm text-muted-foreground\">\n      No data for this range\n    \u003C\u002Fdiv>\n  )\n}\nreturn \u003CResponsiveContainer height={300}>{\u002F* chart *\u002F}\u003C\u002FResponsiveContainer>\n```\n\n## Troubleshooting\n\n| Symptom | Fix |\n|---|---|\n| Axis labels overlap | `\u003CXAxis angle={-45} textAnchor=\"end\" height={80} \u002F>` or `interval=\"preserveStartEnd\"`. |\n| `dataKey` shows nothing | Property name typo or property is missing on some rows — Recharts silently treats `undefined` as a gap. |\n| Animation stutters with live data | `isAnimationActive={false}` on the series. |\n| Chart taking forever to render | Too many points — aggregate \u002F downsample. >1000 per series is the warning sign. |\n\n## Common mistakes\n\nBeyond the four project rules above:\n\n1. **`Cell` count mismatch** — if you map `Cell` over data you must use the same array; mismatched length leaves slices uncolored.\n2. **Re-creating the data array on every render** — causes the chart to re-animate. Memoize with `useMemo` if the source data is stable.\n\n## Resources\n\n- Official docs: https:\u002F\u002Frecharts.org\u002F\n- API reference: https:\u002F\u002Frecharts.org\u002Fen-US\u002Fapi\n- Storybook examples: https:\u002F\u002Frecharts.org\u002Fen-US\u002Fexamples\n","# Charts (Recharts)\n\nRecharts is preinstalled. Composable React + D3 charts. Charts are built by nesting components inside one of `LineChart`, `BarChart`, `AreaChart`, `PieChart`, `ScatterChart`, `RadarChart`, `RadialBarChart`, or `ComposedChart`.\n\n## Project rules\n\n- **Always wrap charts in `\u003CResponsiveContainer width=\"100%\" height={N}>`** — without it the chart renders at 0px height. The parent must have a defined width; height must be a number, not a percentage.\n- **Always use theme tokens** for colors: `var(--chart-1)` through `var(--chart-5)`. Never hardcode hex values — they break dark mode and look generic.\n- **Always render a custom tooltip** so it matches the app's card\u002Fborder styling (default tooltip is white-on-white in dark mode).\n- **Always handle empty data** — render a skeleton or empty state when `data.length === 0`. An empty chart shows axes and confuses users.\n\n## Data shape\n\nRecharts expects an array of objects. Each object is one data point; each numeric property can be plotted as a series.\n\n```ts\nconst data = [\n  { month: \"Jan\", revenue: 4000, expenses: 2400 },\n  { month: \"Feb\", revenue: 3000, expenses: 1398 },\n  { month: \"Mar\", revenue: 2000, expenses: 9800 },\n]\n```\n\n`dataKey` props map object properties to chart components: `dataKey=\"revenue\"`, or `dataKey={(entry) => entry.revenue - entry.expenses}` for derived values (memoize the function with `useCallback` — see references\u002Fadvanced.md).\n\n## Bar chart\n\n```tsx\nimport { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer } from \"recharts\"\n\n\u003CResponsiveContainer width=\"100%\" height={300}>\n  \u003CBarChart data={data}>\n    \u003CCartesianGrid strokeDasharray=\"3 3\" className=\"stroke-border\" \u002F>\n    \u003CXAxis dataKey=\"month\" className=\"text-xs fill-muted-foreground\" \u002F>\n    \u003CYAxis className=\"text-xs fill-muted-foreground\" \u002F>\n    \u003CTooltip content={\u003CChartTooltip \u002F>} \u002F>\n    \u003CLegend \u002F>\n    \u003CBar dataKey=\"revenue\" fill=\"var(--chart-1)\" radius={[4, 4, 0, 0]} \u002F>\n    \u003CBar dataKey=\"expenses\" fill=\"var(--chart-2)\" radius={[4, 4, 0, 0]} \u002F>\n  \u003C\u002FBarChart>\n\u003C\u002FResponsiveContainer>\n```\n\n**Stacked bars** — share a `stackId`, only the top bar gets `radius`:\n\n```tsx\n\u003CBar dataKey=\"completed\" stackId=\"a\" fill=\"var(--chart-1)\" \u002F>\n\u003CBar dataKey=\"pending\" stackId=\"a\" fill=\"var(--chart-2)\" radius={[4, 4, 0, 0]} \u002F>\n```\n\n**Horizontal bar** — flip layout and swap axis types:\n\n```tsx\n\u003CBarChart layout=\"vertical\" data={data}>\n  \u003CXAxis type=\"number\" \u002F>\n  \u003CYAxis type=\"category\" dataKey=\"name\" \u002F>\n  \u003CBar dataKey=\"value\" fill=\"var(--chart-1)\" \u002F>\n\u003C\u002FBarChart>\n```\n\n## Line chart\n\n```tsx\nimport { LineChart, Line } from \"recharts\"\n\n\u003CResponsiveContainer width=\"100%\" height={300}>\n  \u003CLineChart data={data}>\n    \u003CCartesianGrid strokeDasharray=\"3 3\" className=\"stroke-border\" \u002F>\n    \u003CXAxis dataKey=\"month\" className=\"text-xs fill-muted-foreground\" \u002F>\n    \u003CYAxis className=\"text-xs fill-muted-foreground\" \u002F>\n    \u003CTooltip content={\u003CChartTooltip \u002F>} \u002F>\n    \u003CLine type=\"monotone\" dataKey=\"value\" stroke=\"var(--chart-1)\" strokeWidth={2} dot={false} \u002F>\n    \u003CLine type=\"monotone\" dataKey=\"target\" stroke=\"var(--chart-2)\" strokeWidth={2} strokeDasharray=\"5 5\" \u002F>\n  \u003C\u002FLineChart>\n\u003C\u002FResponsiveContainer>\n```\n\n`type` options: `\"monotone\"` (smooth, default for trend data), `\"linear\"`, `\"step\"`, `\"natural\"`. Set `dot={false}` for dense series, `connectNulls` to bridge gaps.\n\n## Area chart\n\n```tsx\nimport { AreaChart, Area } from \"recharts\"\n\n\u003CResponsiveContainer width=\"100%\" height={300}>\n  \u003CAreaChart data={data}>\n    \u003CCartesianGrid strokeDasharray=\"3 3\" className=\"stroke-border\" \u002F>\n    \u003CXAxis dataKey=\"month\" className=\"text-xs fill-muted-foreground\" \u002F>\n    \u003CYAxis className=\"text-xs fill-muted-foreground\" \u002F>\n    \u003CTooltip content={\u003CChartTooltip \u002F>} \u002F>\n    \u003CArea type=\"monotone\" dataKey=\"value\" stroke=\"var(--chart-1)\" fill=\"var(--chart-1)\" fillOpacity={0.2} \u002F>\n  \u003C\u002FAreaChart>\n\u003C\u002FResponsiveContainer>\n```\n\n**Stacked areas** — share a `stackId`:\n\n```tsx\n\u003CArea type=\"monotone\" dataKey=\"ios\" stackId=\"1\" stroke=\"var(--chart-1)\" fill=\"var(--chart-1)\" fillOpacity={0.4} \u002F>\n\u003CArea type=\"monotone\" dataKey=\"android\" stackId=\"1\" stroke=\"var(--chart-2)\" fill=\"var(--chart-2)\" fillOpacity={0.4} \u002F>\n```\n\n**Gradient fill** — define once in `\u003Cdefs>`, reference by URL:\n\n```tsx\n\u003CAreaChart data={data}>\n  \u003Cdefs>\n    \u003ClinearGradient id=\"fillValue\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n      \u003Cstop offset=\"5%\" stopColor=\"var(--chart-1)\" stopOpacity={0.6} \u002F>\n      \u003Cstop offset=\"95%\" stopColor=\"var(--chart-1)\" stopOpacity={0} \u002F>\n    \u003C\u002FlinearGradient>\n  \u003C\u002Fdefs>\n  \u003CArea type=\"monotone\" dataKey=\"value\" stroke=\"var(--chart-1)\" fill=\"url(#fillValue)\" \u002F>\n\u003C\u002FAreaChart>\n```\n\n## Pie \u002F donut chart\n\n```tsx\nimport { PieChart, Pie, Cell } from \"recharts\"\n\nconst COLORS = [\n  \"var(--chart-1)\",\n  \"var(--chart-2)\",\n  \"var(--chart-3)\",\n  \"var(--chart-4)\",\n  \"var(--chart-5)\",\n]\n\n\u003CResponsiveContainer width=\"100%\" height={300}>\n  \u003CPieChart>\n    \u003CPie\n      data={data}\n      dataKey=\"value\"\n      nameKey=\"name\"\n      cx=\"50%\"\n      cy=\"50%\"\n      innerRadius={60}\n      outerRadius={100}\n      paddingAngle={2}\n      label={({ name, percent }) => `${name} ${(percent * 100).toFixed(0)}%`}\n    >\n      {data.map((_, i) => \u003CCell key={i} fill={COLORS[i % COLORS.length]} \u002F>)}\n    \u003C\u002FPie>\n    \u003CTooltip content={\u003CChartTooltip \u002F>} \u002F>\n    \u003CLegend \u002F>\n  \u003C\u002FPieChart>\n\u003C\u002FResponsiveContainer>\n```\n\n`innerRadius={0}` for a solid pie, `> 0` for a donut. `Cell` will be replaced by the `shape` prop in Recharts 4 — `Cell` still works today, plan to migrate when 4 ships.\n\n## Scatter chart\n\n```tsx\nimport { ScatterChart, Scatter } from \"recharts\"\n\n\u003CResponsiveContainer width=\"100%\" height={300}>\n  \u003CScatterChart>\n    \u003CCartesianGrid strokeDasharray=\"3 3\" className=\"stroke-border\" \u002F>\n    \u003CXAxis type=\"number\" dataKey=\"x\" name=\"Weight\" className=\"text-xs fill-muted-foreground\" \u002F>\n    \u003CYAxis type=\"number\" dataKey=\"y\" name=\"Height\" className=\"text-xs fill-muted-foreground\" \u002F>\n    \u003CTooltip cursor={{ strokeDasharray: \"3 3\" }} content={\u003CChartTooltip \u002F>} \u002F>\n    \u003CScatter name=\"Sample A\" data={data} fill=\"var(--chart-1)\" \u002F>\n  \u003C\u002FScatterChart>\n\u003C\u002FResponsiveContainer>\n```\n\nFor bubble charts, add `\u003CZAxis dataKey=\"size\" range={[60, 400]} \u002F>` and the scatter dots scale with the third dimension.\n\n## Reference lines and areas\n\nFor targets, thresholds, and goal markers:\n\n```tsx\nimport { ReferenceLine, ReferenceArea } from \"recharts\"\n\n\u003CLineChart data={data}>\n  {\u002F* ... axes, lines *\u002F}\n  \u003CReferenceLine y={5000} label=\"Target\" stroke=\"var(--chart-3)\" strokeDasharray=\"3 3\" \u002F>\n  \u003CReferenceArea x1=\"Jan\" x2=\"Mar\" fill=\"var(--chart-2)\" fillOpacity={0.1} label=\"Q1\" \u002F>\n\u003C\u002FLineChart>\n```\n\nFor live\u002Fstreaming data, many-chart dashboards, or radar\u002Fradial\u002Fcomposed\u002Fsynced\u002Fbrush charts, Read references\u002Fadvanced.md.\n\n## Click and hover events\n\n```tsx\n\u003CBarChart onClick={(state) => console.log(\"chart click\", state)}>\n  \u003CBar\n    dataKey=\"sales\"\n    fill=\"var(--chart-1)\"\n    onClick={(payload, index) => navigate(`\u002Fitems\u002F${payload.id}`)}\n  \u002F>\n\u003C\u002FBarChart>\n```\n\n`Tooltip` has interaction props for click-to-pin or controlled selection:\n\n```tsx\n\u003CTooltip trigger=\"click\" defaultIndex={0} cursor={false} content={\u003CChartTooltip \u002F>} \u002F>\n```\n\n## Theme-aware custom tooltip\n\n```tsx\nimport type { TooltipProps } from \"recharts\"\n\ninterface TooltipPayloadEntry {\n  name: string\n  value: number\n  color: string\n}\n\nfunction ChartTooltip({ active, payload, label }: TooltipProps\u003Cnumber, string>) {\n  if (!active || !payload?.length) return null\n  return (\n    \u003Cdiv className=\"rounded-lg border bg-card p-3 shadow-md\">\n      \u003Cp className=\"text-sm font-medium mb-1\">{label}\u003C\u002Fp>\n      {payload.map((entry, i) => (\n        \u003Cdiv key={i} className=\"flex items-center gap-2 text-sm\">\n          \u003Cspan className=\"h-2.5 w-2.5 rounded-full\" style={{ backgroundColor: entry.color }} \u002F>\n          \u003Cspan className=\"text-muted-foreground\">{entry.name}:\u003C\u002Fspan>\n          \u003Cspan className=\"font-medium\">{entry.value?.toLocaleString()}\u003C\u002Fspan>\n        \u003C\u002Fdiv>\n      ))}\n    \u003C\u002Fdiv>\n  )\n}\n```\n\nUse on every chart: `\u003CTooltip content={\u003CChartTooltip \u002F>} \u002F>`.\n\n## Axis formatting\n\n```tsx\n\u002F\u002F Currency\n\u003CYAxis tickFormatter={(v) => `$${(v \u002F 1000).toFixed(0)}k`} \u002F>\n\n\u002F\u002F Locale-aware numbers\n\u003CYAxis tickFormatter={(v) => v.toLocaleString()} \u002F>\n\n\u002F\u002F Percentages\n\u003CYAxis tickFormatter={(v) => `${v}%`} domain={[0, 100]} \u002F>\n\n\u002F\u002F Dates with date-fns\nimport { format, parseISO } from \"date-fns\"\n\u003CXAxis dataKey=\"date\" tickFormatter={(v) => format(parseISO(v), \"MMM d\")} \u002F>\n\n\u002F\u002F Rotate when labels overlap\n\u003CXAxis dataKey=\"month\" angle={-45} textAnchor=\"end\" height={60} \u002F>\n\n\u002F\u002F Force every label or auto-thin\n\u003CXAxis interval={0} \u002F>               \u002F\u002F show every label (clip overlapping)\n\u003CXAxis interval=\"preserveStartEnd\" \u002F> \u002F\u002F auto-decide, keep first + last\n```\n\n## Custom domains\n\n```tsx\n\u003CYAxis domain={[0, 100]} \u002F>                              \u002F\u002F fixed range\n\u003CYAxis domain={[0, \"auto\"]} \u002F>                           \u002F\u002F auto upper\n\u003CYAxis domain={[0, \"dataMax + 100\"]} allowDataOverflow \u002F> \u002F\u002F padded\n\u003CYAxis type=\"number\" scale=\"log\" domain={[\"auto\", \"auto\"]} \u002F> \u002F\u002F log scale\n```\n\n## Sparkline + stat card\n\nProject pattern for KPI tiles:\n\n```tsx\nfunction StatCard({ title, value, trend, data }: {\n  title: string\n  value: string\n  trend: string\n  data: { v: number }[]\n}) {\n  return (\n    \u003CCard>\n      \u003CCardContent className=\"p-4\">\n        \u003Cp className=\"text-sm text-muted-foreground\">{title}\u003C\u002Fp>\n        \u003Cp className=\"text-2xl font-bold\">{value}\u003C\u002Fp>\n        \u003Cp className=\"text-xs text-muted-foreground\">{trend}\u003C\u002Fp>\n        \u003CResponsiveContainer width=\"100%\" height={40}>\n          \u003CAreaChart data={data}>\n            \u003CArea\n              type=\"monotone\"\n              dataKey=\"v\"\n              stroke=\"var(--chart-1)\"\n              fill=\"var(--chart-1)\"\n              fillOpacity={0.1}\n              strokeWidth={1.5}\n            \u002F>\n          \u003C\u002FAreaChart>\n        \u003C\u002FResponsiveContainer>\n      \u003C\u002FCardContent>\n    \u003C\u002FCard>\n  )\n}\n```\n\nNo axes, no tooltip, no grid — just the trend.\n\n## Accessibility\n\n`accessibilityLayer` is on by default (keyboard navigable, screen-reader compatible). Always add an aria-label that describes what the chart shows:\n\n```tsx\n\u003CLineChart data={data} role=\"img\" aria-label=\"Monthly revenue, January through June 2026\">\n  {\u002F* ... *\u002F}\n\u003C\u002FLineChart>\n```\n\n## Empty \u002F loading states\n\n```tsx\nif (isPending) return \u003CSkeleton className=\"h-[300px] w-full\" \u002F>\nif (!data.length) {\n  return (\n    \u003Cdiv className=\"flex h-[300px] items-center justify-center text-sm text-muted-foreground\">\n      No data for this range\n    \u003C\u002Fdiv>\n  )\n}\nreturn \u003CResponsiveContainer height={300}>{\u002F* chart *\u002F}\u003C\u002FResponsiveContainer>\n```\n\n## Troubleshooting\n\n| Symptom | Fix |\n|---|---|\n| Axis labels overlap | `\u003CXAxis angle={-45} textAnchor=\"end\" height={80} \u002F>` or `interval=\"preserveStartEnd\"`. |\n| `dataKey` shows nothing | Property name typo or property is missing on some rows — Recharts silently treats `undefined` as a gap. |\n| Animation stutters with live data | `isAnimationActive={false}` on the series. |\n| Chart taking forever to render | Too many points — aggregate \u002F downsample. >1000 per series is the warning sign. |\n\n## Common mistakes\n\nBeyond the four project rules above:\n\n1. **`Cell` count mismatch** — if you map `Cell` over data you must use the same array; mismatched length leaves slices uncolored.\n2. **Re-creating the data array on every render** — causes the chart to re-animate. Memoize with `useMemo` if the source data is stable.\n\n## Resources\n\n- Official docs: https:\u002F\u002Frecharts.org\u002F\n- API reference: https:\u002F\u002Frecharts.org\u002Fen-US\u002Fapi\n- Storybook examples: https:\u002F\u002Frecharts.org\u002Fen-US\u002Fexamples\n",{"name":5,"description":7},"main","c54d8e35f50ac35b3b2c7ba8d4fca2205a740cb9","agent-config\u002Fagents\u002Fapp-builder\u002Fskills\u002Fcharts",9,"https:\u002F\u002Fgithub.com\u002FSimaDevelopment\u002Fopsiforce","https:\u002F\u002Fgithub.com\u002FSimaDevelopment","2026-11-05 06:13:10",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add SimaDevelopment\u002Fopsiforce --skill charts",{"tool":57,"command":58},"bunx","bunx skills add SimaDevelopment\u002Fopsiforce --skill charts",{"tool":60,"command":61},"pnpm","pnpm dlx skills add SimaDevelopment\u002Fopsiforce --skill charts","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSimaDevelopment\u002Fopsiforce\u002Fblob\u002Fmain\u002Fagent-config\u002Fagents\u002Fapp-builder\u002Fskills\u002Fcharts\u002FSKILL.md",true,[65],{"path":66,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":69,"sourceHtmlUrl":70},"references\u002Fadvanced.md","REFERENCE","参考文档",4480,"https:\u002F\u002Fgithub.com\u002FSimaDevelopment\u002Fopsiforce\u002Fblob\u002Fmain\u002Fagent-config\u002Fagents\u002Fapp-builder\u002Fskills\u002Fcharts\u002Freferences\u002Fadvanced.md",[72,97,112,131,139,164],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":39},"01M6QQKHZFGFB6A111RW2A9WC0","figma-use","**MANDATORY prerequisite** — you MUST invoke this skill BEFORE every `use_figma` tool call. NEVER call `use_figma` directly without loading this skill first. Skipping it causes common, hard-to-debug failures. Trigger whenever the user wants to perform a write action or a unique read action that requires JavaScript execution in the Figma file context — e.g. create\u002Fedit\u002Fdelete nodes, set up variables or tokens, build components and variants, modify auto-layout or fills, bind variables to properties, or inspect file structure programmatically.","https:\u002F\u002Fgithub.com\u002FSimaDevelopment\u002Fopsiforce\u002Fblob\u002Fmain\u002Ffrontend\u002Fopencode\u002Fpackages\u002Fplugins\u002Ffigma\u002Fskills\u002Ffigma-use\u002FSKILL.md",[],[79,80,34,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,21,96],"figma use","figma","components","create","delete","tool","read","write","edit","context","auto","structure","tokens","bind","Variables","you","inspect","invoke",{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":39},"01M6QQK1AMA90K6DFAVANYQ9X3","figma-use-slides","This skill helps agents use Figma's use_figma MCP tool in the Slides context. Can be used alongside figma-use which has foundational context for using the use_figma tool.","https:\u002F\u002Fgithub.com\u002FSimaDevelopment\u002Fopsiforce\u002Fblob\u002Fmain\u002Ffrontend\u002Fopencode\u002Fpackages\u002Fplugins\u002Ffigma\u002Fskills\u002Ffigma-use-slides\u002FSKILL.md",[],[79,80,104,105,34,106,84,88,107,108,109,110,111],"figma use slides","slides","MCP","false","which","can","for","figma mcp",{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":39},"01M6QQJTR9QYK297WQ1X792D63","figma-use-motion","Motion \u002F animation context for the `use_figma` MCP tool — animating Figma nodes via manual keyframes, animation styles, easing, and timeline duration. Load alongside figma-use whenever a task involves adding, editing, or inspecting animation on a node.","https:\u002F\u002Fgithub.com\u002FSimaDevelopment\u002Fopsiforce\u002Fblob\u002Fmain\u002Ffrontend\u002Fopencode\u002Fpackages\u002Fplugins\u002Ffigma\u002Fskills\u002Ffigma-use-motion\u002FSKILL.md",[],[79,80,119,34,120,106,121,84,122,123,88,124,125,126,107,127,128,129,130,110],"figma use motion","motion","Animation","node","editing","Nodes","task","keyframes","via","styles","manual","load",{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":39},"01M6QQJNZ067ZRXZ6A0QB9M6SB","figma-use-figjam","This skill helps agents use Figma's use_figma MCP tool in the FigJam context. Can be used alongside figma-use which has foundational context for using the use_figma tool.","https:\u002F\u002Fgithub.com\u002FSimaDevelopment\u002Fopsiforce\u002Fblob\u002Fmain\u002Ffrontend\u002Fopencode\u002Fpackages\u002Fplugins\u002Ffigma\u002Fskills\u002Ffigma-use-figjam\u002FSKILL.md",[],[79,80,138,34,106,84,88,107,108,109,110,111],"figma use figjam",{"skillNo":140,"name":141,"nameZh":6,"description":142,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":143,"categories":144,"keywords":145,"publishedAt":39},"01M6QQJ7NEHXPE33VRVHYYM7YE","figma-swiftui","SwiftUI ↔ Figma translation. Use whenever the user mentions Swift, SwiftUI, iOS, iPhone, or iPad — in EITHER direction — translating a Figma design into SwiftUI (design → code), or pushing SwiftUI views \u002F screens \u002F tokens back into a Figma file (code → design). Triggers on phrases like 'implement this Figma design in SwiftUI', 'build this screen in Swift', 'push this SwiftUI view to Figma', 'mirror my Swift code in a Figma file', or whenever a Figma URL appears alongside `.swift` files \u002F an `.xcodeproj`. Routes to a direction-specific reference doc; loads alongside `figma-use` for the code → design path.","https:\u002F\u002Fgithub.com\u002FSimaDevelopment\u002Fopsiforce\u002Fblob\u002Fmain\u002Ffrontend\u002Fopencode\u002Fpackages\u002Fplugins\u002Ffigma\u002Fskills\u002Ffigma-swiftui\u002FSKILL.md",[],[80,146,147,148,149,150,151,152,153,154,155,156,157,158,107,159,160,161,162,163],"figma swiftui","swiftui","design","swift","code","push","doc","files","translation","back","either","iphone","ipad","screen","direction","URL","my","path",{"skillNo":165,"name":166,"nameZh":6,"description":167,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":168,"categories":169,"keywords":170,"publishedAt":39},"01M6QQJ3WZ3M90BZQ5TD305PKN","figma-shaders","**MANDATORY prerequisite** — load this skill before calling `create_shader` or `update_shader`. Use when the user asks to create, author, change, fix, or iterate on a shader effect, shader fill, custom effect, custom fill, or procedural shader in Figma.","https:\u002F\u002Fgithub.com\u002FSimaDevelopment\u002Fopsiforce\u002Fblob\u002Fmain\u002Ffrontend\u002Fopencode\u002Fpackages\u002Fplugins\u002Ffigma\u002Fskills\u002Ffigma-shaders\u002FSKILL.md",[],[171,80,172,173,82,174,175,176,177,34,178,179,107,180,130,181,182,23,183],"shaders","figma shaders","change","update","effect","user","fix","shader","calling","procedural","fill","iterate","author"]