{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "chart-radial-steps",
  "title": "Steps radial chart",
  "description": "Daily steps toward a goal, as a radial chart with text.",
  "dependencies": [
    "recharts@^3.8.0"
  ],
  "registryDependencies": [
    "card",
    "chart"
  ],
  "files": [
    {
      "path": "registry/base-nova/charts/chart-radial-steps.tsx",
      "content": "\"use client\"\n\nimport {\n  Label,\n  PolarGrid,\n  PolarRadiusAxis,\n  RadialBar,\n  RadialBarChart,\n} from \"recharts\"\n\nimport {\n  Card,\n  CardContent,\n  CardDescription,\n  CardFooter,\n  CardHeader,\n  CardTitle,\n} from \"@/components/ui/card\"\nimport { ChartContainer, type ChartConfig } from \"@/components/ui/chart\"\n\nexport const description =\n  \"Daily steps toward a goal, as a radial chart with text\"\n\nconst goal = 8000\n// Today's steps for a fictional patient after surgery.\nconst chartData = [{ day: \"today\", steps: 5640, fill: \"var(--color-steps)\" }]\n\nconst chartConfig = {\n  steps: {\n    label: \"Steps\",\n    color: \"var(--chart-2)\",\n  },\n} satisfies ChartConfig\n\nexport function ChartRadialSteps() {\n  const steps = chartData[0]!.steps\n  return (\n    <Card className=\"flex flex-col\">\n      <CardHeader className=\"items-center pb-0\">\n        <CardTitle>Steps</CardTitle>\n        <CardDescription>\n          Today, toward a goal of {goal.toLocaleString(\"en-US\")}\n        </CardDescription>\n      </CardHeader>\n      <CardContent className=\"flex-1 pb-0\">\n        <ChartContainer\n          config={chartConfig}\n          className=\"mx-auto aspect-square max-h-[250px]\"\n        >\n          <RadialBarChart\n            data={chartData}\n            startAngle={90}\n            endAngle={90 - (steps / goal) * 360}\n            innerRadius={80}\n            outerRadius={110}\n          >\n            <PolarGrid\n              gridType=\"circle\"\n              radialLines={false}\n              stroke=\"none\"\n              className=\"first:fill-muted last:fill-background\"\n              polarRadius={[86, 74]}\n            />\n            <RadialBar dataKey=\"steps\" background cornerRadius={10} />\n            <PolarRadiusAxis tick={false} tickLine={false} axisLine={false}>\n              <Label\n                content={({ viewBox }) => {\n                  if (viewBox && \"cx\" in viewBox && \"cy\" in viewBox) {\n                    return (\n                      <text\n                        x={viewBox.cx}\n                        y={viewBox.cy}\n                        textAnchor=\"middle\"\n                        dominantBaseline=\"middle\"\n                      >\n                        <tspan\n                          x={viewBox.cx}\n                          y={viewBox.cy}\n                          className=\"fill-foreground text-4xl font-bold\"\n                        >\n                          {steps.toLocaleString(\"en-US\")}\n                        </tspan>\n                        <tspan\n                          x={viewBox.cx}\n                          y={(viewBox.cy || 0) + 24}\n                          className=\"fill-muted-foreground\"\n                        >\n                          steps\n                        </tspan>\n                      </text>\n                    )\n                  }\n                }}\n              />\n            </PolarRadiusAxis>\n          </RadialBarChart>\n        </ChartContainer>\n      </CardContent>\n      <CardFooter className=\"flex-col gap-2 text-sm\">\n        <div className=\"flex items-center gap-2 leading-none font-medium\">\n          {Math.round((steps / goal) * 100)}% of the daily goal\n        </div>\n        <div className=\"leading-none text-muted-foreground\">\n          {steps < goal\n            ? `${(goal - steps).toLocaleString(\"en-US\")} steps to go`\n            : \"Goal reached\"}\n          ; a fictional patient\n        </div>\n      </CardFooter>\n    </Card>\n  )\n}\n",
      "type": "registry:block"
    }
  ],
  "docs": "Steps radial chart: https://organui.com/charts/radial#chart-radial-steps",
  "categories": [
    "charts",
    "charts-radial"
  ],
  "type": "registry:block"
}