{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "chart-gauge",
  "title": "Gauge",
  "description": "Live CPU load on an arc, with zones from your chart colors.",
  "dependencies": [
    "@wick-charts/react@^0.9.2"
  ],
  "registryDependencies": [
    "card",
    "https://wick-charts.eeff.io/r/wick-chart.json"
  ],
  "files": [
    {
      "path": "blocks/chart-gauge.tsx",
      "content": "\"use client\"\n\nimport { useEffect, useState } from \"react\"\n\nimport { GaugeSeries } from \"@wick-charts/react\"\n\nimport {\n  Card,\n  CardContent,\n  CardDescription,\n  CardHeader,\n  CardTitle,\n} from \"@/components/ui/card\"\nimport { WickChart } from \"@/components/ui/wick-chart\"\n\nconst TICK_MS = 1000\n\nconst formatPercent = (value: number) => `${Math.round(value)}%`\n\nconst gaugeOptions = {\n  label: \"CPU load\",\n  format: formatPercent,\n  zones: [{ to: 60 }, { to: 85 }, { to: 100 }],\n}\n\n// Demo feed: replace with your own metric.\nfunction nextLoad(previous: number): number {\n  const drift = (58 - previous) * 0.1\n  const load = previous + drift + (Math.random() - 0.5) * 14\n\n  return Math.min(100, Math.max(0, load))\n}\n\nexport function ChartGauge() {\n  const [load, setLoad] = useState(58)\n\n  useEffect(() => {\n    const timer = setInterval(() => setLoad(nextLoad), TICK_MS)\n\n    return () => clearInterval(timer)\n  }, [])\n\n  return (\n    <Card>\n      <CardHeader>\n        <CardTitle>Server load</CardTitle>\n        <CardDescription>api-1, updated every second</CardDescription>\n      </CardHeader>\n      <CardContent>\n        <WickChart className=\"aspect-auto h-[240px]\">\n          <GaugeSeries value={load} options={gaugeOptions} />\n        </WickChart>\n      </CardContent>\n    </Card>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "categories": [
    "charts",
    "monitoring"
  ],
  "type": "registry:block"
}