{"name":"chart","title":"Chart","description":"Beautiful charts. Built with d3 and Marko — server-rendered, themeable with CSS variables. A shadcn theme's `--chart-1..5` variables restyle every chart with zero changes. Text scales with container width (the SVG uses a fixed viewBox — the price of zero-JS SSR); only the tooltip hydrates.","installCommand":"bunx marko-ui add chart -y","usageTags":"<Chart>, <ChartBar>","importSnippet":"import Chart from \"@/components/ui/chart/chart.marko\";\nimport ChartBar from \"@/components/ui/chart/bar.marko\";","usageSnippet":"static const chartData = [\n  { month: \"Jan\", desktop: 186 },\n  { month: \"Feb\", desktop: 305 },\n];\nstatic const chartConfig = { desktop: { label: \"Desktop\", color: \"var(--chart-1)\" } };\n\n<Chart config=chartConfig>\n  <ChartBar data=chartData config=chartConfig xKey=\"month\">\n    <@series dataKey=\"desktop\" radius=4/>\n  </ChartBar>\n</Chart>","tags":["Chart","ChartArea","ChartBar","ChartLine","ChartPie","ChartTooltip"],"parts":[],"props":[{"name":"config","type":"ChartConfig","required":true}],"events":[],"keyboard":[],"accessibilityNotes":["Charts are pure SSR SVG plus one small client hydration for hover tooltips — there is no keyboard navigation or `accessibilityLayer`-equivalent focus ring today (upstream's Recharts `accessibilityLayer` prop, which adds keyboard access and screen-reader summaries, has no port here — a component-source gap, not a docs gap).","Chart color is never the only signal in a well-built chart: pair every series color with a label in the legend or tooltip (`ChartConfig.label`) rather than color alone.","The tooltip's indicator + label + value are read together in DOM order, so screen readers announce a coherent row per series when the tooltip is inspected."],"examples":[{"id":"chart-example","title":"Your First Chart","source":"import Chart from \"@marko-ui/shadcn/ui/chart/chart.marko\";\nimport BarChart from \"@marko-ui/shadcn/ui/chart/bar.marko\";\n\nstatic const chartData = [\n  { month: \"January\", desktop: 186, mobile: 80 },\n  { month: \"February\", desktop: 305, mobile: 200 },\n  { month: \"March\", desktop: 237, mobile: 120 },\n  { month: \"April\", desktop: 73, mobile: 190 },\n  { month: \"May\", desktop: 209, mobile: 130 },\n  { month: \"June\", desktop: 214, mobile: 140 },\n];\n\nstatic const chartConfig = {\n  desktop: { label: \"Desktop\", color: \"#2563eb\" },\n  mobile: { label: \"Mobile\", color: \"#60a5fa\" },\n};\n\n<Chart config=chartConfig class=\"min-h-[200px] w-full\">\n  <BarChart data=chartData config=chartConfig xKey=\"month\" grid=false tooltip=false>\n    <@series dataKey=\"desktop\" radius=4/>\n    <@series dataKey=\"mobile\" radius=4/>\n  </BarChart>\n</Chart>","description":"The minimal composition: `<Chart>` wrapping a `<BarChart>` with two `@series`, grid and tooltip both off."},{"id":"chart-demo","title":"Bar Chart - Interactive","source":"import Chart from \"@marko-ui/shadcn/ui/chart/chart.marko\";\nimport BarChart from \"@marko-ui/shadcn/ui/chart/bar.marko\";\nimport Card from \"@marko-ui/shadcn/ui/card/card.marko\";\nimport CardHeader from \"@marko-ui/shadcn/ui/card/header.marko\";\nimport CardTitle from \"@marko-ui/shadcn/ui/card/title.marko\";\nimport CardDescription from \"@marko-ui/shadcn/ui/card/description.marko\";\nimport CardContent from \"@marko-ui/shadcn/ui/card/content.marko\";\n\nstatic const chartData = [\n  { date: \"2024-04-01\", desktop: 222, mobile: 150 },\n  { date: \"2024-04-02\", desktop: 97, mobile: 180 },\n  { date: \"2024-04-03\", desktop: 167, mobile: 120 },\n  { date: \"2024-04-04\", desktop: 242, mobile: 260 },\n  { date: \"2024-04-05\", desktop: 373, mobile: 290 },\n  { date: \"2024-04-06\", desktop: 301, mobile: 340 },\n  { date: \"2024-04-07\", desktop: 245, mobile: 180 },\n  { date: \"2024-04-08\", desktop: 409, mobile: 320 },\n  { date: \"2024-04-09\", desktop: 59, mobile: 110 },\n  { date: \"2024-04-10\", desktop: 261, mobile: 190 },\n  { date: \"2024-04-11\", desktop: 327, mobile: 350 },\n  { date: \"2024-04-12\", desktop: 292, mobile: 210 },\n  { date: \"2024-04-13\", desktop: 342, mobile: 380 },\n  { date: \"2024-04-14\", desktop: 137, mobile: 220 },\n  { date: \"2024-04-15\", desktop: 120, mobile: 170 },\n  { date: \"2024-04-16\", desktop: 138, mobile: 190 },\n  { date: \"2024-04-17\", desktop: 446, mobile: 360 },\n  { date: \"2024-04-18\", desktop: 364, mobile: 410 },\n  { date: \"2024-04-19\", desktop: 243, mobile: 180 },\n  { date: \"2024-04-20\", desktop: 89, mobile: 150 },\n  { date: \"2024-04-21\", desktop: 137, mobile: 200 },\n  { date: \"2024-04-22\", desktop: 224, mobile: 170 },\n  { date: \"2024-04-23\", desktop: 138, mobile: 230 },\n  { date: \"2024-04-24\", desktop: 387, mobile: 290 },\n  { date: \"2024-04-25\", desktop: 215, mobile: 250 },\n  { date: \"2024-04-26\", desktop: 75, mobile: 130 },\n  { date: \"2024-04-27\", desktop: 383, mobile: 420 },\n  { date: \"2024-04-28\", desktop: 122, mobile: 180 },\n  { date: \"2024-04-29\", desktop: 315, mobile: 240 },\n  { date: \"2024-04-30\", desktop: 454, mobile: 380 },\n];\n\nstatic const chartConfig = {\n  views: { label: \"Page Views\" },\n  desktop: { label: \"Desktop\", color: \"var(--chart-2)\" },\n  mobile: { label: \"Mobile\", color: \"var(--chart-1)\" },\n};\n\nstatic const totals = {\n  desktop: chartData.reduce((acc, curr) => acc + curr.desktop, 0),\n  mobile: chartData.reduce((acc, curr) => acc + curr.mobile, 0),\n};\n\nstatic function formatShortDate(value: string): string {\n  return new Date(value).toLocaleDateString(\"en-US\", { month: \"short\", day: \"numeric\" });\n}\n\nstatic function formatLongDate(value: string): string {\n  return new Date(value).toLocaleDateString(\"en-US\", { month: \"short\", day: \"numeric\", year: \"numeric\" });\n}\n\n<let/activeChart=\"desktop\"/>\n\n<Card class=\"py-0 pb-4\">\n  <CardHeader class=\"flex flex-col items-stretch border-b p-0! sm:flex-row\">\n    <div class=\"flex flex-1 flex-col justify-center gap-1 px-6 pt-4 pb-3 sm:py-0!\">\n      <CardTitle>Bar Chart - Interactive</CardTitle>\n      <CardDescription>\n        Showing total visitors for the last 3 months\n      </CardDescription>\n    </div>\n    <div class=\"flex\">\n      <for|key| of=([\"desktop\", \"mobile\"] as const)>\n        <button\n          type=\"button\"\n          data-active=String(activeChart === key)\n          class=\"relative z-30 flex flex-1 flex-col justify-center gap-1 border-t px-6 py-4 text-left even:border-l data-[active=true]:bg-muted/50 sm:border-t-0 sm:border-l sm:px-8 sm:py-6\"\n          onClick() { activeChart = key; }\n        >\n          <span class=\"text-xs text-muted-foreground\">${chartConfig[key].label}</span>\n          <span class=\"text-lg leading-none font-bold sm:text-3xl\">${totals[key].toLocaleString()}</span>\n        </button>\n      </for>\n    </div>\n  </CardHeader>\n  <CardContent class=\"px-2 sm:p-6\">\n    <Chart config=chartConfig class=\"aspect-auto h-[250px] w-full\">\n      <BarChart\n        data=chartData\n        config=chartConfig\n        xKey=\"date\"\n        width=628\n        height=250\n        margin={ left: 12, right: 12 }\n        xTickFormatter=formatShortDate\n        xTickMinGap=32\n        tooltipLabelFormatter=formatLongDate\n        cursor\n      >\n        <@series dataKey=activeChart/>\n      </BarChart>\n    </Chart>\n  </CardContent>\n</Card>","description":"The hero interactive demo: a series-toggle header swaps which `@series` the chart renders, backed by plain demo-file `<let>` state — no primitive changes needed."},{"id":"chart-example-grid","title":"Add a Grid","source":"import Chart from \"@marko-ui/shadcn/ui/chart/chart.marko\";\nimport BarChart from \"@marko-ui/shadcn/ui/chart/bar.marko\";\n\nstatic const chartData = [\n  { month: \"January\", desktop: 186, mobile: 80 },\n  { month: \"February\", desktop: 305, mobile: 200 },\n  { month: \"March\", desktop: 237, mobile: 120 },\n  { month: \"April\", desktop: 73, mobile: 190 },\n  { month: \"May\", desktop: 209, mobile: 130 },\n  { month: \"June\", desktop: 214, mobile: 140 },\n];\n\nstatic const chartConfig = {\n  desktop: { label: \"Desktop\", color: \"#2563eb\" },\n  mobile: { label: \"Mobile\", color: \"#60a5fa\" },\n};\n\n<Chart config=chartConfig class=\"min-h-[200px] w-full\">\n  <BarChart data=chartData config=chartConfig xKey=\"month\" grid tooltip=false>\n    <@series dataKey=\"desktop\" radius=4/>\n    <@series dataKey=\"mobile\" radius=4/>\n  </BarChart>\n</Chart>","description":"The same chart with `grid` turned on — horizontal `CartesianGrid` lines behind the bars."},{"id":"chart-example-axis","title":"Add an Axis","source":"import Chart from \"@marko-ui/shadcn/ui/chart/chart.marko\";\nimport BarChart from \"@marko-ui/shadcn/ui/chart/bar.marko\";\n\nstatic const chartData = [\n  { month: \"January\", desktop: 186, mobile: 80 },\n  { month: \"February\", desktop: 305, mobile: 200 },\n  { month: \"March\", desktop: 237, mobile: 120 },\n  { month: \"April\", desktop: 73, mobile: 190 },\n  { month: \"May\", desktop: 209, mobile: 130 },\n  { month: \"June\", desktop: 214, mobile: 140 },\n];\n\nstatic const chartConfig = {\n  desktop: { label: \"Desktop\", color: \"#2563eb\" },\n  mobile: { label: \"Mobile\", color: \"#60a5fa\" },\n};\n\n<Chart config=chartConfig class=\"h-[200px] w-full\">\n  <BarChart\n    data=chartData\n    config=chartConfig\n    xKey=\"month\"\n    xTickFormatter=(value) => value.slice(0, 3)\n    tickMargin=10\n    tooltip=false\n  >\n    <@series dataKey=\"desktop\" radius=4/>\n    <@series dataKey=\"mobile\" radius=4/>\n  </BarChart>\n</Chart>","description":"Grid plus an `xTickFormatter` that slices each month name down to 3 letters, with `tickMargin=10`."},{"id":"chart-example-tooltip","title":"Add Tooltip","source":"import Chart from \"@marko-ui/shadcn/ui/chart/chart.marko\";\nimport BarChart from \"@marko-ui/shadcn/ui/chart/bar.marko\";\n\nstatic const chartData = [\n  { month: \"January\", desktop: 186, mobile: 80 },\n  { month: \"February\", desktop: 305, mobile: 200 },\n  { month: \"March\", desktop: 237, mobile: 120 },\n  { month: \"April\", desktop: 73, mobile: 190 },\n  { month: \"May\", desktop: 209, mobile: 130 },\n  { month: \"June\", desktop: 214, mobile: 140 },\n];\n\nstatic const chartConfig = {\n  desktop: { label: \"Desktop\", color: \"#2563eb\" },\n  mobile: { label: \"Mobile\", color: \"#60a5fa\" },\n};\n\n<Chart config=chartConfig class=\"h-[200px] w-full\">\n  <BarChart\n    data=chartData\n    config=chartConfig\n    xKey=\"month\"\n    xTickFormatter=(value) => value.slice(0, 3)\n    tickMargin=10\n    tooltip\n  >\n    <@series dataKey=\"desktop\" radius=4/>\n    <@series dataKey=\"mobile\" radius=4/>\n  </BarChart>\n</Chart>","description":"Grid, axis, and the default hover tooltip (`tooltip` defaults to `true` — shown here explicitly to match the step-by-step build-up)."},{"id":"chart-example-legend","title":"Add Legend","source":"import Chart from \"@marko-ui/shadcn/ui/chart/chart.marko\";\nimport BarChart from \"@marko-ui/shadcn/ui/chart/bar.marko\";\n\nstatic const chartData = [\n  { month: \"January\", desktop: 186, mobile: 80 },\n  { month: \"February\", desktop: 305, mobile: 200 },\n  { month: \"March\", desktop: 237, mobile: 120 },\n  { month: \"April\", desktop: 73, mobile: 190 },\n  { month: \"May\", desktop: 209, mobile: 130 },\n  { month: \"June\", desktop: 214, mobile: 140 },\n];\n\nstatic const chartConfig = {\n  desktop: { label: \"Desktop\", color: \"#2563eb\" },\n  mobile: { label: \"Mobile\", color: \"#60a5fa\" },\n};\n\n<Chart config=chartConfig class=\"h-[200px] w-full\">\n  <BarChart\n    data=chartData\n    config=chartConfig\n    xKey=\"month\"\n    xTickFormatter=(value) => value.slice(0, 3)\n    tickMargin=10\n    tooltip\n    legend=\"bottom\"\n  >\n    <@series dataKey=\"desktop\" radius=4/>\n    <@series dataKey=\"mobile\" radius=4/>\n  </BarChart>\n</Chart>","description":"The full build: grid, axis, tooltip, and `legend=\"bottom\"` rendering a `<ChartLegendContent>`-equivalent swatch row."},{"id":"chart-bar-default","title":"Bar Chart","source":"import Chart from \"@marko-ui/shadcn/ui/chart/chart.marko\";\nimport BarChart from \"@marko-ui/shadcn/ui/chart/bar.marko\";\nimport Card from \"@marko-ui/shadcn/ui/card/card.marko\";\nimport CardHeader from \"@marko-ui/shadcn/ui/card/header.marko\";\nimport CardTitle from \"@marko-ui/shadcn/ui/card/title.marko\";\nimport CardDescription from \"@marko-ui/shadcn/ui/card/description.marko\";\nimport CardContent from \"@marko-ui/shadcn/ui/card/content.marko\";\nimport CardFooter from \"@marko-ui/shadcn/ui/card/footer.marko\";\n\nstatic const chartData = [\n  { month: \"January\", desktop: 186 },\n  { month: \"February\", desktop: 305 },\n  { month: \"March\", desktop: 237 },\n  { month: \"April\", desktop: 73 },\n  { month: \"May\", desktop: 209 },\n  { month: \"June\", desktop: 214 },\n];\n\nstatic const chartConfig = {\n  desktop: {\n    label: \"Desktop\",\n    color: \"var(--chart-1)\",\n  },\n};\n\n<Card>\n  <CardHeader>\n    <CardTitle>Bar Chart</CardTitle>\n    <CardDescription>January - June 2024</CardDescription>\n  </CardHeader>\n  <CardContent>\n    <Chart config=chartConfig>\n      <BarChart\n        data=chartData\n        config=chartConfig\n        xKey=\"month\"\n        xTickFormatter=(value) => value.slice(0, 3)\n        tickMargin=10\n        cursor=false\n        hideLabel\n      >\n        <@series dataKey=\"desktop\" radius=8/>\n      </BarChart>\n    </Chart>\n  </CardContent>\n  <CardFooter class=\"flex-col items-start gap-2 text-sm\">\n    <div class=\"flex gap-2 leading-none font-medium\">\n      Trending up by 5.2% this month\n      <svg\n        xmlns=\"http://www.w3.org/2000/svg\"\n        viewBox=\"0 0 24 24\"\n        fill=\"none\"\n        stroke=\"currentColor\"\n        stroke-width=\"2\"\n        stroke-linecap=\"round\"\n        stroke-linejoin=\"round\"\n        class=\"h-4 w-4\"\n      ><path d=\"M16 7h6v6\"/><path d=\"m22 7-8.5 8.5-5-5L2 17\"/></svg>\n    </div>\n    <div class=\"leading-none text-muted-foreground\">\n      Showing total visitors for the last 6 months\n    </div>\n  </CardFooter>\n</Card>","description":"A single-series bar chart. Colors flow from `chartConfig` through `--color-<key>` variables — never resolved in JS."},{"id":"chart-bar-multiple","title":"Bar Chart - Multiple","source":"import Chart from \"@marko-ui/shadcn/ui/chart/chart.marko\";\nimport BarChart from \"@marko-ui/shadcn/ui/chart/bar.marko\";\nimport Card from \"@marko-ui/shadcn/ui/card/card.marko\";\nimport CardHeader from \"@marko-ui/shadcn/ui/card/header.marko\";\nimport CardTitle from \"@marko-ui/shadcn/ui/card/title.marko\";\nimport CardDescription from \"@marko-ui/shadcn/ui/card/description.marko\";\nimport CardContent from \"@marko-ui/shadcn/ui/card/content.marko\";\nimport CardFooter from \"@marko-ui/shadcn/ui/card/footer.marko\";\n\nstatic const chartData = [\n  { month: \"January\", desktop: 186, mobile: 80 },\n  { month: \"February\", desktop: 305, mobile: 200 },\n  { month: \"March\", desktop: 237, mobile: 120 },\n  { month: \"April\", desktop: 73, mobile: 190 },\n  { month: \"May\", desktop: 209, mobile: 130 },\n  { month: \"June\", desktop: 214, mobile: 140 },\n];\n\nstatic const chartConfig = {\n  desktop: {\n    label: \"Desktop\",\n    color: \"var(--chart-1)\",\n  },\n  mobile: {\n    label: \"Mobile\",\n    color: \"var(--chart-2)\",\n  },\n};\n\n<Card>\n  <CardHeader>\n    <CardTitle>Bar Chart - Multiple</CardTitle>\n    <CardDescription>January - June 2024</CardDescription>\n  </CardHeader>\n  <CardContent>\n    <Chart config=chartConfig>\n      <BarChart\n        data=chartData\n        config=chartConfig\n        xKey=\"month\"\n        xTickFormatter=(value) => value.slice(0, 3)\n        tickMargin=10\n        cursor=false\n        indicator=\"dashed\"\n      >\n        <@series dataKey=\"desktop\" radius=4/>\n        <@series dataKey=\"mobile\" radius=4/>\n      </BarChart>\n    </Chart>\n  </CardContent>\n  <CardFooter class=\"flex-col items-start gap-2 text-sm\">\n    <div class=\"flex gap-2 leading-none font-medium\">\n      Trending up by 5.2% this month\n      <svg\n        xmlns=\"http://www.w3.org/2000/svg\"\n        viewBox=\"0 0 24 24\"\n        fill=\"none\"\n        stroke=\"currentColor\"\n        stroke-width=\"2\"\n        stroke-linecap=\"round\"\n        stroke-linejoin=\"round\"\n        class=\"h-4 w-4\"\n      ><path d=\"M16 7h6v6\"/><path d=\"m22 7-8.5 8.5-5-5L2 17\"/></svg>\n    </div>\n    <div class=\"leading-none text-muted-foreground\">\n      Showing total visitors for the last 6 months\n    </div>\n  </CardFooter>\n</Card>","description":"Multiple `@series` split each band. Pass `indicator=\"dashed\"` to change the tooltip indicator."},{"id":"chart-line-default","title":"Line Chart","source":"import Chart from \"@marko-ui/shadcn/ui/chart/chart.marko\";\nimport LineChart from \"@marko-ui/shadcn/ui/chart/line.marko\";\nimport Card from \"@marko-ui/shadcn/ui/card/card.marko\";\nimport CardHeader from \"@marko-ui/shadcn/ui/card/header.marko\";\nimport CardTitle from \"@marko-ui/shadcn/ui/card/title.marko\";\nimport CardDescription from \"@marko-ui/shadcn/ui/card/description.marko\";\nimport CardContent from \"@marko-ui/shadcn/ui/card/content.marko\";\nimport CardFooter from \"@marko-ui/shadcn/ui/card/footer.marko\";\n\nstatic const chartData = [\n  { month: \"January\", desktop: 186 },\n  { month: \"February\", desktop: 305 },\n  { month: \"March\", desktop: 237 },\n  { month: \"April\", desktop: 73 },\n  { month: \"May\", desktop: 209 },\n  { month: \"June\", desktop: 214 },\n];\n\nstatic const chartConfig = {\n  desktop: {\n    label: \"Desktop\",\n    color: \"var(--chart-1)\",\n  },\n};\n\n<Card>\n  <CardHeader>\n    <CardTitle>Line Chart</CardTitle>\n    <CardDescription>January - June 2024</CardDescription>\n  </CardHeader>\n  <CardContent>\n    <Chart config=chartConfig>\n      <LineChart\n        data=chartData\n        config=chartConfig\n        xKey=\"month\"\n        xTickFormatter=(value) => value.slice(0, 3)\n        cursor=false\n        hideLabel\n      >\n        <@series dataKey=\"desktop\" type=\"natural\" strokeWidth=2/>\n      </LineChart>\n    </Chart>\n  </CardContent>\n  <CardFooter class=\"flex-col items-start gap-2 text-sm\">\n    <div class=\"flex gap-2 leading-none font-medium\">\n      Trending up by 5.2% this month\n      <svg\n        xmlns=\"http://www.w3.org/2000/svg\"\n        viewBox=\"0 0 24 24\"\n        fill=\"none\"\n        stroke=\"currentColor\"\n        stroke-width=\"2\"\n        stroke-linecap=\"round\"\n        stroke-linejoin=\"round\"\n        class=\"h-4 w-4\"\n      >\n        <path d=\"M16 7h6v6\"/>\n        <path d=\"m22 7-8.5 8.5-5-5L2 17\"/>\n      </svg>\n    </div>\n    <div class=\"leading-none text-muted-foreground\">\n      Showing total visitors for the last 6 months\n    </div>\n  </CardFooter>\n</Card>","description":"A single-series line chart with a natural curve. Pass `dot` on a series to render point markers."},{"id":"chart-line-multiple","title":"Line Chart - Multiple","source":"import Chart from \"@marko-ui/shadcn/ui/chart/chart.marko\";\nimport LineChart from \"@marko-ui/shadcn/ui/chart/line.marko\";\nimport Card from \"@marko-ui/shadcn/ui/card/card.marko\";\nimport CardHeader from \"@marko-ui/shadcn/ui/card/header.marko\";\nimport CardTitle from \"@marko-ui/shadcn/ui/card/title.marko\";\nimport CardDescription from \"@marko-ui/shadcn/ui/card/description.marko\";\nimport CardContent from \"@marko-ui/shadcn/ui/card/content.marko\";\nimport CardFooter from \"@marko-ui/shadcn/ui/card/footer.marko\";\n\nstatic const chartData = [\n  { month: \"January\", desktop: 186, mobile: 80 },\n  { month: \"February\", desktop: 305, mobile: 200 },\n  { month: \"March\", desktop: 237, mobile: 120 },\n  { month: \"April\", desktop: 73, mobile: 190 },\n  { month: \"May\", desktop: 209, mobile: 130 },\n  { month: \"June\", desktop: 214, mobile: 140 },\n];\n\nstatic const chartConfig = {\n  desktop: {\n    label: \"Desktop\",\n    color: \"var(--chart-1)\",\n  },\n  mobile: {\n    label: \"Mobile\",\n    color: \"var(--chart-2)\",\n  },\n};\n\n<Card>\n  <CardHeader>\n    <CardTitle>Line Chart - Multiple</CardTitle>\n    <CardDescription>January - June 2024</CardDescription>\n  </CardHeader>\n  <CardContent>\n    <Chart config=chartConfig>\n      <LineChart\n        data=chartData\n        config=chartConfig\n        xKey=\"month\"\n        xTickFormatter=(value) => value.slice(0, 3)\n        cursor=false\n      >\n        <@series dataKey=\"desktop\" type=\"monotone\" strokeWidth=2/>\n        <@series dataKey=\"mobile\" type=\"monotone\" strokeWidth=2/>\n      </LineChart>\n    </Chart>\n  </CardContent>\n  <CardFooter>\n    <div class=\"flex w-full items-start gap-2 text-sm\">\n      <div class=\"grid gap-2\">\n        <div class=\"flex items-center gap-2 leading-none font-medium\">\n          Trending up by 5.2% this month\n          <svg\n            xmlns=\"http://www.w3.org/2000/svg\"\n            viewBox=\"0 0 24 24\"\n            fill=\"none\"\n            stroke=\"currentColor\"\n            stroke-width=\"2\"\n            stroke-linecap=\"round\"\n            stroke-linejoin=\"round\"\n            class=\"h-4 w-4\"\n          >\n            <path d=\"M16 7h6v6\"/>\n            <path d=\"m22 7-8.5 8.5-5-5L2 17\"/>\n          </svg>\n        </div>\n        <div class=\"flex items-center gap-2 leading-none text-muted-foreground\">\n          Showing total visitors for the last 6 months\n        </div>\n      </div>\n    </div>\n  </CardFooter>\n</Card>","description":"Multiple lines share the same y scale. `type` picks the curve: `natural`, `linear`, `monotone`, or `step`."},{"id":"chart-area-default","title":"Area Chart","source":"import Chart from \"@marko-ui/shadcn/ui/chart/chart.marko\";\nimport AreaChart from \"@marko-ui/shadcn/ui/chart/area.marko\";\nimport Card from \"@marko-ui/shadcn/ui/card/card.marko\";\nimport CardHeader from \"@marko-ui/shadcn/ui/card/header.marko\";\nimport CardTitle from \"@marko-ui/shadcn/ui/card/title.marko\";\nimport CardDescription from \"@marko-ui/shadcn/ui/card/description.marko\";\nimport CardContent from \"@marko-ui/shadcn/ui/card/content.marko\";\nimport CardFooter from \"@marko-ui/shadcn/ui/card/footer.marko\";\n\nstatic const chartData = [\n  { month: \"January\", desktop: 186 },\n  { month: \"February\", desktop: 305 },\n  { month: \"March\", desktop: 237 },\n  { month: \"April\", desktop: 73 },\n  { month: \"May\", desktop: 209 },\n  { month: \"June\", desktop: 214 },\n];\n\nstatic const chartConfig = {\n  desktop: {\n    label: \"Desktop\",\n    color: \"var(--chart-1)\",\n  },\n};\n\n<Card>\n  <CardHeader>\n    <CardTitle>Area Chart</CardTitle>\n    <CardDescription>\n      Showing total visitors for the last 6 months\n    </CardDescription>\n  </CardHeader>\n  <CardContent>\n    <Chart config=chartConfig>\n      <AreaChart\n        data=chartData\n        config=chartConfig\n        xKey=\"month\"\n        xTickFormatter=(value) => value.slice(0, 3)\n        indicator=\"line\"\n        cursor=false\n      >\n        <@series dataKey=\"desktop\" type=\"natural\"/>\n      </AreaChart>\n    </Chart>\n  </CardContent>\n  <CardFooter>\n    <div class=\"flex w-full items-start gap-2 text-sm\">\n      <div class=\"grid gap-2\">\n        <div class=\"flex items-center gap-2 leading-none font-medium\">\n          Trending up by 5.2% this month\n          <svg\n            xmlns=\"http://www.w3.org/2000/svg\"\n            viewBox=\"0 0 24 24\"\n            fill=\"none\"\n            stroke=\"currentColor\"\n            stroke-width=\"2\"\n            stroke-linecap=\"round\"\n            stroke-linejoin=\"round\"\n            class=\"h-4 w-4\"\n          >\n            <path d=\"M16 7h6v6\"/>\n            <path d=\"m22 7-8.5 8.5-5-5L2 15\"/>\n          </svg>\n        </div>\n        <div class=\"flex items-center gap-2 leading-none text-muted-foreground\">\n          January - June 2024\n        </div>\n      </div>\n    </div>\n  </CardFooter>\n</Card>","description":"A single-series area chart. The fill uses the series color at `fillOpacity` 0.4, like the shadcn demos."},{"id":"chart-area-gradient","title":"Area Chart - Gradient","source":"import Chart from \"@marko-ui/shadcn/ui/chart/chart.marko\";\nimport AreaChart from \"@marko-ui/shadcn/ui/chart/area.marko\";\nimport Card from \"@marko-ui/shadcn/ui/card/card.marko\";\nimport CardHeader from \"@marko-ui/shadcn/ui/card/header.marko\";\nimport CardTitle from \"@marko-ui/shadcn/ui/card/title.marko\";\nimport CardDescription from \"@marko-ui/shadcn/ui/card/description.marko\";\nimport CardContent from \"@marko-ui/shadcn/ui/card/content.marko\";\nimport CardFooter from \"@marko-ui/shadcn/ui/card/footer.marko\";\n\nstatic const chartData = [\n  { month: \"January\", desktop: 186, mobile: 80 },\n  { month: \"February\", desktop: 305, mobile: 200 },\n  { month: \"March\", desktop: 237, mobile: 120 },\n  { month: \"April\", desktop: 73, mobile: 190 },\n  { month: \"May\", desktop: 209, mobile: 130 },\n  { month: \"June\", desktop: 214, mobile: 140 },\n];\n\nstatic const chartConfig = {\n  desktop: {\n    label: \"Desktop\",\n    color: \"var(--chart-1)\",\n  },\n  mobile: {\n    label: \"Mobile\",\n    color: \"var(--chart-2)\",\n  },\n};\n\n<Card>\n  <CardHeader>\n    <CardTitle>Area Chart - Gradient</CardTitle>\n    <CardDescription>\n      Showing total visitors for the last 6 months\n    </CardDescription>\n  </CardHeader>\n  <CardContent>\n    <Chart config=chartConfig>\n      <AreaChart\n        data=chartData\n        config=chartConfig\n        xKey=\"month\"\n        xTickFormatter=(value) => value.slice(0, 3)\n        cursor=false\n      >\n        <@series dataKey=\"mobile\" type=\"natural\" stackId=\"a\" gradient/>\n        <@series dataKey=\"desktop\" type=\"natural\" stackId=\"a\" gradient/>\n      </AreaChart>\n    </Chart>\n  </CardContent>\n  <CardFooter>\n    <div class=\"flex w-full items-start gap-2 text-sm\">\n      <div class=\"grid gap-2\">\n        <div class=\"flex items-center gap-2 leading-none font-medium\">\n          Trending up by 5.2% this month\n          <svg\n            xmlns=\"http://www.w3.org/2000/svg\"\n            viewBox=\"0 0 24 24\"\n            fill=\"none\"\n            stroke=\"currentColor\"\n            stroke-width=\"2\"\n            stroke-linecap=\"round\"\n            stroke-linejoin=\"round\"\n            class=\"h-4 w-4\"\n          >\n            <path d=\"M16 7h6v6\"/>\n            <path d=\"m22 7-8.5 8.5-5-5L2 15\"/>\n          </svg>\n        </div>\n        <div class=\"flex items-center gap-2 leading-none text-muted-foreground\">\n          January - June 2024\n        </div>\n      </div>\n    </div>\n  </CardFooter>\n</Card>","description":"Stacked areas with `gradient` fills — per-series `<linearGradient>` defs fading the series color from 0.8 to 0.1 opacity."},{"id":"chart-pie-simple","title":"Pie Chart","source":"import Chart from \"@marko-ui/shadcn/ui/chart/chart.marko\";\nimport PieChart from \"@marko-ui/shadcn/ui/chart/pie.marko\";\nimport Card from \"@marko-ui/shadcn/ui/card/card.marko\";\nimport CardHeader from \"@marko-ui/shadcn/ui/card/header.marko\";\nimport CardTitle from \"@marko-ui/shadcn/ui/card/title.marko\";\nimport CardDescription from \"@marko-ui/shadcn/ui/card/description.marko\";\nimport CardContent from \"@marko-ui/shadcn/ui/card/content.marko\";\nimport CardFooter from \"@marko-ui/shadcn/ui/card/footer.marko\";\n\nstatic const chartData = [\n  { browser: \"chrome\", visitors: 275, fill: \"var(--color-chrome)\" },\n  { browser: \"safari\", visitors: 200, fill: \"var(--color-safari)\" },\n  { browser: \"firefox\", visitors: 187, fill: \"var(--color-firefox)\" },\n  { browser: \"edge\", visitors: 173, fill: \"var(--color-edge)\" },\n  { browser: \"other\", visitors: 90, fill: \"var(--color-other)\" },\n];\n\nstatic const chartConfig = {\n  visitors: { label: \"Visitors\" },\n  chrome: { label: \"Chrome\", color: \"var(--chart-1)\" },\n  safari: { label: \"Safari\", color: \"var(--chart-2)\" },\n  firefox: { label: \"Firefox\", color: \"var(--chart-3)\" },\n  edge: { label: \"Edge\", color: \"var(--chart-4)\" },\n  other: { label: \"Other\", color: \"var(--chart-5)\" },\n};\n\n<Card class=\"flex w-full max-w-sm flex-col\">\n  <CardHeader class=\"items-center pb-0\">\n    <CardTitle>Pie Chart</CardTitle>\n    <CardDescription>January - June 2024</CardDescription>\n  </CardHeader>\n  <CardContent class=\"flex-1 pb-0\">\n    <Chart config=chartConfig class=\"mx-auto aspect-square max-h-[250px]\">\n      <PieChart\n        config=chartConfig\n        data=chartData\n        dataKey=\"visitors\"\n        nameKey=\"browser\"\n      />\n    </Chart>\n  </CardContent>\n  <CardFooter class=\"flex-col gap-2 text-sm\">\n    <div class=\"flex items-center gap-2 leading-none font-medium\">\n      Trending up by 5.2% this month\n      <svg\n        xmlns=\"http://www.w3.org/2000/svg\"\n        viewBox=\"0 0 24 24\"\n        fill=\"none\"\n        stroke=\"currentColor\"\n        stroke-width=\"2\"\n        stroke-linecap=\"round\"\n        stroke-linejoin=\"round\"\n        class=\"h-4 w-4\"\n      >\n        <polyline points=\"22 7 13.5 15.5 8.5 10.5 2 17\"/>\n        <polyline points=\"16 7 22 7 22 13\"/>\n      </svg>\n    </div>\n    <div class=\"leading-none text-muted-foreground\">\n      Showing total visitors for the last 6 months\n    </div>\n  </CardFooter>\n</Card>","description":"Slice colors come from each row's `fill` (e.g. `var(--color-chrome)`), resolved by the chart's scoped style — exactly like shadcn's pie demos."},{"id":"chart-pie-donut","title":"Pie Chart - Donut with Text","source":"import Chart from \"@marko-ui/shadcn/ui/chart/chart.marko\";\nimport PieChart from \"@marko-ui/shadcn/ui/chart/pie.marko\";\nimport Card from \"@marko-ui/shadcn/ui/card/card.marko\";\nimport CardHeader from \"@marko-ui/shadcn/ui/card/header.marko\";\nimport CardTitle from \"@marko-ui/shadcn/ui/card/title.marko\";\nimport CardDescription from \"@marko-ui/shadcn/ui/card/description.marko\";\nimport CardContent from \"@marko-ui/shadcn/ui/card/content.marko\";\nimport CardFooter from \"@marko-ui/shadcn/ui/card/footer.marko\";\n\nstatic const chartData = [\n  { browser: \"chrome\", visitors: 275, fill: \"var(--color-chrome)\" },\n  { browser: \"safari\", visitors: 200, fill: \"var(--color-safari)\" },\n  { browser: \"firefox\", visitors: 187, fill: \"var(--color-firefox)\" },\n  { browser: \"edge\", visitors: 173, fill: \"var(--color-edge)\" },\n  { browser: \"other\", visitors: 90, fill: \"var(--color-other)\" },\n];\n\nstatic const chartConfig = {\n  visitors: { label: \"Visitors\" },\n  chrome: { label: \"Chrome\", color: \"var(--chart-1)\" },\n  safari: { label: \"Safari\", color: \"var(--chart-2)\" },\n  firefox: { label: \"Firefox\", color: \"var(--chart-3)\" },\n  edge: { label: \"Edge\", color: \"var(--chart-4)\" },\n  other: { label: \"Other\", color: \"var(--chart-5)\" },\n};\n\nstatic const totalVisitors = chartData.reduce(\n  (acc, curr) => acc + curr.visitors,\n  0,\n);\n\n<Card class=\"flex w-full max-w-sm flex-col\">\n  <CardHeader class=\"items-center pb-0\">\n    <CardTitle>Pie Chart - Donut with Text</CardTitle>\n    <CardDescription>January - June 2024</CardDescription>\n  </CardHeader>\n  <CardContent class=\"flex-1 pb-0\">\n    <Chart config=chartConfig class=\"mx-auto aspect-square max-h-[250px]\">\n      <PieChart\n        config=chartConfig\n        data=chartData\n        dataKey=\"visitors\"\n        nameKey=\"browser\"\n        innerRadius=60\n      >\n        <@centerLabel|{ cx, cy }|>\n          <text x=cx y=cy text-anchor=\"middle\" dominant-baseline=\"middle\">\n            <tspan x=cx y=cy class=\"fill-foreground text-3xl font-bold\">\n              ${totalVisitors.toLocaleString()}\n            </tspan>\n            <tspan x=cx y=(cy + 24) class=\"fill-muted-foreground\">\n              Visitors\n            </tspan>\n          </text>\n        </@centerLabel>\n      </PieChart>\n    </Chart>\n  </CardContent>\n  <CardFooter class=\"flex-col gap-2 text-sm\">\n    <div class=\"flex items-center gap-2 leading-none font-medium\">\n      Trending up by 5.2% this month\n      <svg\n        xmlns=\"http://www.w3.org/2000/svg\"\n        viewBox=\"0 0 24 24\"\n        fill=\"none\"\n        stroke=\"currentColor\"\n        stroke-width=\"2\"\n        stroke-linecap=\"round\"\n        stroke-linejoin=\"round\"\n        class=\"h-4 w-4\"\n      >\n        <polyline points=\"22 7 13.5 15.5 8.5 10.5 2 17\"/>\n        <polyline points=\"16 7 22 7 22 13\"/>\n      </svg>\n    </div>\n    <div class=\"leading-none text-muted-foreground\">\n      Showing total visitors for the last 6 months\n    </div>\n  </CardFooter>\n</Card>","description":"Pass `innerRadius` for a donut and `centerLabel` to render content in the middle."},{"id":"chart-tooltip","title":"Tooltip Anatomy","source":"import ChartTooltip from \"@marko-ui/shadcn/ui/chart/tooltip.marko\";\n\n<div class=\"grid aspect-video w-full max-w-md justify-center text-foreground md:grid-cols-2 [&>div]:relative [&>div]:flex [&>div]:h-[137px] [&>div]:w-[224px] [&>div]:items-center [&>div]:justify-center [&>div]:p-4\">\n  <div>\n    <div class=\"absolute top-[45px] left-[-35px] z-10 text-sm font-medium\">\n      Label\n    </div>\n    <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 193 40\" width=\"50\" height=\"12\" fill=\"none\" class=\"absolute top-[50px] left-[5px] z-10\">\n      <g clip-path=\"url(#chart-tooltip-a)\">\n        <path fill=\"currentColor\" d=\"M173.928 21.13C115.811 44.938 58.751 45.773 0 26.141c4.227-4.386 7.82-2.715 10.567-1.88 21.133 5.64 42.9 6.266 64.457 7.101 31.066 1.253 60.441-5.848 89.183-17.335 1.268-.418 2.325-1.253 4.861-2.924-14.582-2.924-29.165 2.089-41.845-3.76.212-.835.212-1.879.423-2.714 9.51-.627 19.231-1.253 28.742-2.089 9.51-.835 18.808-1.88 28.318-2.506 6.974-.418 9.933 2.924 7.397 9.19-3.17 8.145-7.608 15.664-11.623 23.391-.423.836-1.057 1.88-1.902 2.298-2.325.835-4.65 1.044-7.186 1.67-.422-2.088-1.479-4.386-1.268-6.265.423-2.506 1.902-4.595 3.804-9.19Z\"/>\n      </g>\n      <defs>\n        <clipPath id=\"chart-tooltip-a\">\n          <path fill=\"currentColor\" d=\"M0 0h193v40H0z\"/>\n        </clipPath>\n      </defs>\n    </svg>\n    <ChartTooltip\n      label=\"Page Views\"\n      rows=[\n        { key: \"desktop\", label: \"Desktop\", value: 186, color: \"var(--chart-1)\" },\n        { key: \"mobile\", label: \"Mobile\", value: 80, color: \"var(--chart-2)\" },\n      ]\n      class=\"w-[8rem]\"\n    />\n  </div>\n  <div class=\"items-end\">\n    <div class=\"absolute top-[0px] left-[122px] z-10 text-sm font-medium\">\n      Name\n    </div>\n    <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"35\" height=\"42\" fill=\"none\" viewBox=\"0 0 122 148\" class=\"absolute top-[10px] left-[85px] z-10 -scale-x-100\">\n      <g clip-path=\"url(#chart-tooltip-ab)\">\n        <path fill=\"currentColor\" d=\"M0 2.65c6.15-4.024 12.299-2.753 17.812-.847a115.56 115.56 0 0 1 21.84 10.59C70.4 32.727 88.849 61.744 96.483 97.54c1.908 9.108 2.544 18.639 3.817 29.017 8.481-4.871 12.934-14.402 21.416-19.909 1.061 4.236-1.06 6.989-2.756 9.319-6.998 9.531-14.207 19.062-21.63 28.382-3.604 4.448-6.36 4.871-10.177 1.059-8.058-7.837-12.935-17.368-14.42-28.382 0-.424.636-1.059 1.485-2.118 9.118 2.33 6.997 13.979 14.843 18.215 3.393-14.614.848-28.593-2.969-42.149-4.029-14.19-9.33-27.746-17.812-39.82-8.27-11.86-18.66-21.392-30.11-30.287C26.93 11.758 14.207 6.039 0 2.65Z\"/>\n      </g>\n      <defs>\n        <clipPath id=\"chart-tooltip-ab\">\n          <path fill=\"currentColor\" d=\"M0 0h122v148H0z\"/>\n        </clipPath>\n      </defs>\n    </svg>\n    <ChartTooltip\n      label=\"Browser\"\n      hideLabel\n      indicator=\"dashed\"\n      rows=[\n        { key: \"chrome\", label: \"Chrome\", value: 1286, color: \"var(--chart-3)\" },\n        { key: \"firefox\", label: \"Firefox\", value: 1000, color: \"var(--chart-4)\" },\n      ]\n      class=\"w-[8rem]\"\n    />\n  </div>\n  <div class=\"hidden! md:flex!\">\n    <ChartTooltip\n      label=\"Page Views\"\n      indicator=\"line\"\n      rows=[\n        { key: \"desktop\", label: \"Desktop\", value: 12486, color: \"var(--chart-3)\" },\n      ]\n      class=\"w-[9rem]\"\n    />\n  </div>\n  <div class=\"items-start! justify-start!\">\n    <div class=\"absolute top-[60px] left-[50px] z-10 text-sm font-medium\">\n      Indicator\n    </div>\n    <ChartTooltip\n      label=\"Browser\"\n      hideLabel\n      indicator=\"dot\"\n      rows=[\n        { key: \"chrome\", label: \"Chrome\", value: 1286, color: \"var(--chart-1)\" },\n      ]\n      class=\"w-[8rem]\"\n    />\n    <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"34\" fill=\"none\" viewBox=\"0 0 75 175\" class=\"absolute top-[38px] left-[30px] z-10 rotate-[-40deg]\">\n      <g clip-path=\"url(#chart-tooltip-abc)\">\n        <path fill=\"currentColor\" d=\"M20.187 175c-4.439-2.109-7.186-2.531-8.032-4.008-3.17-5.484-6.763-10.968-8.454-17.084-5.073-16.242-4.439-32.694-1.057-49.146 5.707-28.053 18.388-52.942 34.24-76.565 1.692-2.531 3.171-5.063 4.862-7.805 0-.21-.211-.632-.634-1.265-4.65 1.265-9.511 2.53-14.161 3.585-2.537.422-5.496.422-8.032-.421-1.48-.422-3.593-2.742-3.593-4.219 0-1.898 1.48-4.218 2.747-5.906 1.057-1.054 2.96-1.265 4.65-1.687C35.406 7.315 48.088 3.729 60.98.776c10.99-2.53 14.584 1.055 13.95 11.812-.634 11.18-.846 22.358-1.268 33.326-.212 3.375-.846 6.96-1.268 10.757-8.878-4.007-8.878-4.007-12.048-38.177C47.03 33.259 38.153 49.289 29.91 65.741 21.667 82.193 16.17 99.49 13.212 117.84c-2.959 18.984.634 36.912 6.975 57.161Z\"/>\n      </g>\n      <defs>\n        <clipPath id=\"chart-tooltip-abc\">\n          <path fill=\"currentColor\" d=\"M0 0h75v175H0z\"/>\n        </clipPath>\n      </defs>\n    </svg>\n  </div>\n</div>","description":"The four tooltip pieces — label, name, value, and indicator — shown at their default sizes with the `indicator` variants (`dot`, `line`, `dashed`)."},{"id":"chart-rtl","title":"RTL","source":"import Chart from \"@marko-ui/shadcn/ui/chart/chart.marko\";\nimport BarChart from \"@marko-ui/shadcn/ui/chart/bar.marko\";\n\nstatic const chartData = [\n  { month: \"يناير\", desktop: 186, mobile: 80 },\n  { month: \"فبراير\", desktop: 305, mobile: 200 },\n  { month: \"مارس\", desktop: 237, mobile: 120 },\n  { month: \"أبريل\", desktop: 73, mobile: 190 },\n  { month: \"مايو\", desktop: 209, mobile: 130 },\n  { month: \"يونيو\", desktop: 214, mobile: 140 },\n];\n\nstatic const chartConfig = {\n  desktop: { label: \"سطح المكتب\", color: \"var(--chart-2)\" },\n  mobile: { label: \"الجوال\", color: \"var(--chart-1)\" },\n};\n\n<div dir=\"rtl\">\n  <Chart config=chartConfig class=\"min-h-[200px] w-full\">\n    <BarChart\n      data=chartData\n      config=chartConfig\n      xKey=\"month\"\n      tickMargin=10\n      legend=\"bottom\"\n    >\n      <@series dataKey=\"desktop\" radius=4/>\n      <@series dataKey=\"mobile\" radius=4/>\n    </BarChart>\n  </Chart>\n</div>","description":"Static Arabic labels under a `dir=\"rtl\"` wrapper. **Deviation from upstream:** shadcn's RTL demo also mirrors the plot itself (grid orientation, axis direction); our `BarChart` has no `orientation`/`reversed` props yet, so only the labels/legend/tooltip flip — the plot geometry stays left-to-right. Upstream's RTL demo also drives a live language switcher; this one is static Arabic content (locale `ar`)."}],"importInstallCommand":"bun add @marko-ui/shadcn marko-zag","body":{},"nativeAttributes":"div","subcomponents":[{"name":"area","props":[{"name":"config","type":"ChartConfig","required":true,"description":"Same object passed to <Chart> — Marko has no context, so it's passed twice."},{"name":"data","type":"Row[]","required":true},{"name":"xKey","type":"string","required":true,"description":"Category field for the x axis, e.g. \"month\"."},{"name":"class","type":"string","required":false},{"name":"cursor","type":"boolean","required":false,"description":"Vertical cursor line on hover (recharts default). Shadcn area demos pass false."},{"name":"grid","type":"boolean","required":false,"description":"Horizontal grid lines (recharts <CartesianGrid vertical={false}/>)."},{"name":"height","type":"number","required":false},{"name":"hideLabel","type":"boolean","required":false},{"name":"indicator","type":"'line' | 'dot' | 'dashed'","required":false},{"name":"legend","type":"boolean | 'bottom' | 'top'","required":false},{"name":"margin","type":"Partial<Margin>","required":false},{"name":"stackOffset","type":"'expand'","required":false,"description":"\"expand\" ⇒ 100% stacked (recharts stackOffset=\"expand\"). Requires stacked series."},{"name":"tooltip","type":"boolean","required":false},{"name":"tooltipLabelFormatter","type":"(value: string) => string","required":false,"description":"Applied to the tooltip's label row only (recharts ChartTooltipContent labelFormatter)."},{"name":"width","type":"number","required":false,"description":"viewBox size — the container's CSS aspect scales the drawing."},{"name":"xTickFormatter","type":"(value: string) => string","required":false,"description":"Applied to axis tick labels only (like recharts' XAxis tickFormatter)."},{"name":"xTickMinGap","type":"number","required":false,"description":"Minimum pixel gap between kept x-axis ticks (recharts XAxis minTickGap) — thins dense date-series ticks."},{"name":"yAxis","type":"boolean","required":false},{"name":"yAxisTickCount","type":"number","required":false,"description":"Approximate number of y-axis ticks (recharts YAxis tickCount). Default 5."}],"parts":[{"name":"series","attributes":[{"name":"dataKey","type":"string","required":true},{"name":"type","type":"CurveType","required":false,"description":"Curve type (recharts `type`). Default \"natural\", like the shadcn demos."},{"name":"stackId","type":"string","required":false,"description":"Series sharing a stackId stack on top of each other (declaration order = bottom to top)."},{"name":"gradient","type":"boolean","required":false,"description":"Fill with a per-series <linearGradient> fading the series color 0.8 → 0.1."},{"name":"fillOpacity","type":"number","required":false}],"repeatable":true}]},{"name":"bar","props":[{"name":"config","type":"ChartConfig","required":true,"description":"Same object passed to <Chart> — Marko has no context, so it is passed twice."},{"name":"data","type":"Row[]","required":true},{"name":"xKey","type":"string","required":true},{"name":"activeIndex","type":"number","required":false,"description":"Highlights one bar (fill-opacity 0.8, dashed stroke in its own row.fill color) — mirrors chart-bar-active."},{"name":"categoryTickFormatter","type":"(value: string) => string","required":false,"description":"category-axis tick formatter (Y axis in horizontal layout, X axis otherwise)."},{"name":"class","type":"string","required":false},{"name":"cursor","type":"boolean","required":false,"description":"Tooltip cursor rect behind the hovered band (recharts default)."},{"name":"grid","type":"boolean","required":false,"description":"Horizontal grid lines (recharts <CartesianGrid vertical={false}/>). Default true."},{"name":"height","type":"number","required":false},{"name":"hideIndicator","type":"boolean","required":false},{"name":"hideLabel","type":"boolean","required":false},{"name":"indicator","type":"'line' | 'dot' | 'dashed'","required":false},{"name":"labels","type":"LabelSpec[]","required":false,"description":"Bar (or, in horizontal layout, the single-series bar) LabelList-equivalents."},{"name":"layout","type":"'horizontal'","required":false,"description":"recharts' own (confusing) naming: \"horizontal\" renders HORIZONTAL bars."},{"name":"legend","type":"boolean | 'bottom' | 'top'","required":false},{"name":"margin","type":"Partial<Margin>","required":false},{"name":"stacked","type":"boolean","required":false},{"name":"tickMargin","type":"number","required":false},{"name":"tooltip","type":"boolean","required":false,"description":"Default true. `false` ⇒ no tooltip panel and no cursor."},{"name":"tooltipLabelFormatter","type":"(value: string) => string","required":false,"description":"Applied to the tooltip's label row only (recharts ChartTooltipContent labelFormatter)."},{"name":"width","type":"number","required":false},{"name":"xTickFormatter","type":"(value: string) => string","required":false},{"name":"xTickMinGap","type":"number","required":false,"description":"Minimum pixel gap between kept x-axis ticks (recharts XAxis minTickGap) — thins dense date-series ticks."},{"name":"yAxis","type":"boolean","required":false,"description":"Render the y axis (default false — shadcn demos hide it)."}],"parts":[{"name":"series","attributes":[{"name":"dataKey","type":"string","required":true},{"name":"radius","type":"CornerRadius","required":false,"description":"recharts Bar radius: number rounds all 4 corners, [tl,tr,br,bl] tuple per corner."}],"repeatable":true}]},{"name":"line","props":[{"name":"config","type":"ChartConfig","required":true,"description":"Same object passed to <chart> — Marko has no context, so it travels twice."},{"name":"data","type":"Row[]","required":true},{"name":"xKey","type":"string","required":true},{"name":"class","type":"string","required":false},{"name":"cursor","type":"boolean","required":false,"description":"false ⇒ no hover cursor line. Default true."},{"name":"grid","type":"boolean","required":false,"description":"Horizontal grid lines (recharts <CartesianGrid vertical={false}/>). Default true."},{"name":"height","type":"number","required":false},{"name":"hideLabel","type":"boolean","required":false},{"name":"indicator","type":"'line' | 'dot' | 'dashed'","required":false},{"name":"legend","type":"boolean | 'bottom' | 'top'","required":false},{"name":"margin","type":"Partial<Margin>","required":false},{"name":"tooltip","type":"boolean","required":false,"description":"false ⇒ no tooltip (and no hover state at all). Default true."},{"name":"tooltipLabelFormatter","type":"(value: string) => string","required":false,"description":"Applied to the tooltip's label row only (recharts ChartTooltipContent labelFormatter)."},{"name":"width","type":"number","required":false},{"name":"xTickFormatter","type":"(value: string) => string","required":false},{"name":"xTickMinGap","type":"number","required":false,"description":"Minimum pixel gap between kept x-axis ticks (recharts XAxis minTickGap) — thins dense date-series ticks."},{"name":"yAxis","type":"boolean","required":false,"description":"Default false — matches the shadcn demos."}],"parts":[{"name":"series","attributes":[{"name":"dataKey","type":"string","required":true},{"name":"type","type":"CurveType","required":false,"description":"Curve type (default \"natural\" — the shadcn line-default demo)."},{"name":"strokeWidth","type":"number","required":false},{"name":"dot","type":"boolean","required":false,"description":"Render point markers (default false — shadcn demos hide dots)."},{"name":"dotColorByRow","type":"boolean","required":false,"description":"Dot fill comes from each row's own `fill` field instead of the series color (chart-line-dots-colors)."},{"name":"dotContent","type":"Marko.AttrTag<{ content: Marko.Body<[{ x: number; y: number; row: Row }]> }>","required":false,"description":"Replaces the default <circle> dot with custom content per point (chart-line-dots-custom)."},{"name":"labels","type":"LabelSpec[]","required":false,"description":"LabelList-equivalent: value (or another field) rendered above each point."}],"repeatable":true}]},{"name":"pie","props":[{"name":"config","type":"ChartConfig","required":true,"description":"Same object passed to <Chart> — Marko has no context, so it's passed twice."},{"name":"data","type":"Row[]","required":true},{"name":"dataKey","type":"string","required":true,"description":"Value field, e.g. \"visitors\"."},{"name":"nameKey","type":"string","required":true,"description":"Category field, e.g. \"browser\"."},{"name":"activeIndex","type":"number","required":false,"description":"Highlights one sector at outerRadius + activeOuterRadiusDelta (default 10) — mirrors chart-pie-donut-active / chart-pie-interactive."},{"name":"activeOuterRadiusDelta","type":"number","required":false},{"name":"class","type":"string","required":false},{"name":"height","type":"number","required":false},{"name":"indicator","type":"'line' | 'dot' | 'dashed'","required":false},{"name":"innerRadius","type":"number","required":false,"description":"Donut when > 0 (recharts default 0)."},{"name":"legend","type":"boolean | 'bottom' | 'top'","required":false},{"name":"outerRadius","type":"number","required":false,"description":"Defaults to 80% of the max radius, like recharts."},{"name":"outsideLabel","type":"boolean","required":false,"description":"Plain numeric-value label with a leader line, positioned outside each slice (recharts' bare `label` prop)."},{"name":"paddingAngle","type":"number","required":false,"description":"Degrees between sectors, like recharts' paddingAngle."},{"name":"rings","type":"PieRing[]","required":false,"description":"Additional concentric rings — e.g. chart-pie-stacked's inner/outer donut pair. `data`'s own ring uses `dataKey`/`nameKey`/`innerRadius`/`outerRadius` above as ring 0."},{"name":"strokeWidth","type":"number","required":false,"description":"Sector border width (recharts Pie strokeWidth, default 1). 0 removes the white separator."},{"name":"tooltip","type":"boolean","required":false},{"name":"width","type":"number","required":false,"description":"viewBox size — the container's CSS aspect scales the drawing."}],"parts":[{"name":"centerLabel","param":"{ cx: number; cy: number; }","description":"Rendered inside the svg, receives the pie center — for donut text."},{"name":"sliceLabel","param":"{ x: number; y: number; row: Row; value: number; index: number; }","description":"Custom label rendered at each slice's centroid — e.g. value-in-foreground-color or category-name-in-background-color."}]},{"name":"tooltip","props":[{"name":"rows","type":"TooltipRow[]","required":true},{"name":"hideIndicator","type":"boolean","required":false},{"name":"hideLabel","type":"boolean","required":false},{"name":"indicator","type":"'line' | 'dot' | 'dashed'","required":false},{"name":"label","type":"string","required":false,"description":"Resolved x label — already run through the chart config by the caller."}],"nativeAttributes":"div"}],"itemTypes":[{"prop":"labels","typeName":"LabelSpec","fields":[{"name":"dataKey","type":"string","required":false,"description":"Which field to render — defaults to the bar's own dataKey (value labels)."},{"name":"position","type":"\"top\" | \"right\" | \"insideLeft\"","required":false},{"name":"color","type":"string","required":false,"description":"CSS color (e.g. \"var(--foreground)\" or \"var(--color-label)\"). Default currentColor via fill-foreground parity class."},{"name":"formatter","type":"(value: string) => string","required":false}]},{"prop":"rings","typeName":"PieRing","fields":[{"name":"data","type":"Row[]","required":true},{"name":"dataKey","type":"string","required":true},{"name":"nameKey","type":"string","required":false},{"name":"innerRadius","type":"number","required":false},{"name":"outerRadius","type":"number","required":false},{"name":"paddingAngle","type":"number","required":false}]},{"prop":"rows","typeName":"TooltipRow","fields":[{"name":"key","type":"string","required":true},{"name":"label","type":"string","required":true},{"name":"value","type":"number | string","required":true},{"name":"color","type":"string","required":true},{"name":"icon","type":"Marko.Renderable","required":false}]}],"concepts":"Every chart takes the same `config` object twice: once on `<Chart>` (which emits a scoped `<style>` resolving `--color-<key>` per theme) and again on the chart tag itself (Marko has no context/provider primitive, so the config can't be read implicitly by descendants). Each config entry's `color` can be a literal (`\"#2563eb\"`), an `hsl()`/`oklch()` string, or a `var(--chart-1)` reference into the 5 `--chart-1`..`--chart-5` custom properties a shadcn theme defines for light and dark — swap the theme and every chart restyles with zero code changes. Reference a resolved color from series data or Tailwind with `var(--color-<key>)`, e.g. `fill=\"var(--color-desktop)\"` or a `fill-(--color-desktop)` utility class."}
