{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "chart-radar-outcomes",
  "title": "Outcomes radar chart",
  "description": "Patient-reported outcomes before and after, as a radar chart.",
  "dependencies": [
    "recharts@^3.8.0"
  ],
  "registryDependencies": [
    "card",
    "chart"
  ],
  "files": [
    {
      "path": "registry/base-nova/charts/chart-radar-outcomes.tsx",
      "content": "\"use client\"\n\nimport { PolarAngleAxis, PolarGrid, Radar, RadarChart } from \"recharts\"\n\nimport {\n  Card,\n  CardContent,\n  CardDescription,\n  CardFooter,\n  CardHeader,\n  CardTitle,\n} from \"@/components/ui/card\"\nimport {\n  ChartContainer,\n  ChartLegend,\n  ChartLegendContent,\n  ChartTooltip,\n  ChartTooltipContent,\n  type ChartConfig,\n} from \"@/components/ui/chart\"\nimport { IconPlaceholder } from \"@/icons/icon-placeholder\"\n\nexport const description =\n  \"Patient-reported outcomes before and after, as a radar chart\"\n\n// Scores from 0 to 100, higher is better, a fictional patient.\nconst chartData = [\n  { domain: \"Mobility\", before: 42, after: 71 },\n  { domain: \"Self-care\", before: 55, after: 80 },\n  { domain: \"Activities\", before: 38, after: 66 },\n  { domain: \"Pain relief\", before: 30, after: 64 },\n  { domain: \"Mood\", before: 58, after: 72 },\n]\n\nconst chartConfig = {\n  before: {\n    label: \"Before surgery\",\n    color: \"var(--chart-1)\",\n  },\n  after: {\n    label: \"Six months after\",\n    color: \"var(--chart-2)\",\n  },\n} satisfies ChartConfig\n\nconst improved = chartData.every(({ before, after }) => after > before)\nconst most = chartData.reduce((a, b) =>\n  b.after - b.before > a.after - a.before ? b : a\n)\n\nexport function ChartRadarOutcomes() {\n  return (\n    <Card>\n      <CardHeader className=\"items-center pb-4\">\n        <CardTitle>Outcomes</CardTitle>\n        <CardDescription>\n          Before and six months after a hip replacement\n        </CardDescription>\n      </CardHeader>\n      <CardContent className=\"pb-0\">\n        <ChartContainer\n          config={chartConfig}\n          className=\"mx-auto aspect-square max-h-[250px]\"\n        >\n          <RadarChart data={chartData} outerRadius=\"66%\">\n            <ChartTooltip\n              cursor={false}\n              content={<ChartTooltipContent indicator=\"line\" />}\n            />\n            <PolarAngleAxis dataKey=\"domain\" />\n            <PolarGrid />\n            <Radar\n              dataKey=\"before\"\n              fill=\"var(--color-before)\"\n              fillOpacity={0.6}\n            />\n            <Radar\n              dataKey=\"after\"\n              fill=\"var(--color-after)\"\n              fillOpacity={0.6}\n            />\n            <ChartLegend content={<ChartLegendContent />} />\n          </RadarChart>\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          {improved ? \"Better in every domain\" : \"Better in some domains\"}{\" \"}\n          {/* Both read as better, so both trend up. */}\n          <IconPlaceholder\n            lucide=\"TrendingUpIcon\"\n            tabler=\"IconTrendingUp\"\n            hugeicons=\"ChartUpIcon\"\n            phosphor=\"TrendUpIcon\"\n            remixicon=\"RiArrowUpLine\"\n            className=\"size-4\"\n          />\n        </div>\n        <div className=\"leading-none text-muted-foreground\">\n          {most.domain} improved most; a fictional patient\n        </div>\n      </CardFooter>\n    </Card>\n  )\n}\n",
      "type": "registry:block"
    }
  ],
  "docs": "Outcomes radar chart: https://organui.com/charts/radar#chart-radar-outcomes",
  "categories": [
    "charts",
    "charts-radar"
  ],
  "type": "registry:block"
}