{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "bar-chart",
  "title": "Bar chart",
  "description": "Grouped, stacked or horizontal bars that grow from the baseline on view and morph when data changes, with a gliding hover band, legend toggles, value labels and 2px surface gaps between segments.",
  "dependencies": [
    "motion"
  ],
  "registryDependencies": [
    "https://goodui.dev/r/chart-legend.json",
    "https://goodui.dev/r/goodui-motion.json",
    "https://goodui.dev/r/locale.json"
  ],
  "files": [
    {
      "path": "registry/components/charts/bar-chart.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\"\nimport { cn } from \"@/lib/utils\"\nimport { ChartLegend } from \"@/components/goodui/chart-legend\"\nimport { useLabels } from \"@/lib/goodui-locale\"\nimport { GooduiTokens, spring as springs } from \"@/lib/goodui-motion\"\n\nexport type BarSeries = {\n  key: string\n  label: string\n  /** One value per category, in order. Stacked mode expects values of 0 or more. */\n  data: number[]\n  /** Any CSS color. Defaults to the theme chart colors in series order (--chart-1 … --chart-5). */\n  color?: string\n}\n\nexport type BarChartLabels = {\n  summary: (name: string, seriesCount: number, categoryCount: number) => string\n  /** Announced while scrubbing: `parts` is \"Series: value, Series: value\". */\n  point: (category: string, parts: string) => string\n  total: string\n  legend: string\n  columnCategory: string\n  noData: string\n}\nconst DEFAULT_LABELS: BarChartLabels = {\n  summary: (name, s, c) => `${name ? name + \": \" : \"\"}${s} series across ${c} categories`,\n  point: (category, parts) => `${category}: ${parts}`,\n  total: \"Total\",\n  legend: \"Series\",\n  columnCategory: \"Category\",\n  noData: \"No data\",\n}\n\nexport type BarChartProps = Omit<React.ComponentProps<\"div\">, \"title\" | \"hidden\"> & {\n  series: BarSeries[]\n  categories: string[]\n  /** Chart name for screen readers and the table caption. */\n  title?: React.ReactNode\n  /** grouped: one bar per series side by side. stacked: one bar per category, segments separated by a 2px gap. */\n  mode?: \"grouped\" | \"stacked\"\n  /** vertical columns or horizontal bars (category labels on the start side, values along the bottom). */\n  orientation?: \"vertical\" | \"horizontal\"\n  /** Prints the value at each bar's end (the stack total in stacked mode). */\n  valueLabels?: boolean\n  /** Maximum bar thickness in px; the rest of the slot stays air. */\n  barSize?: number\n  /** Corner radius of the data end in px. The baseline end stays square. */\n  radius?: number\n  /** Keys of hidden series (controlled). */\n  hidden?: string[]\n  defaultHidden?: string[]\n  onHiddenChange?: (hidden: string[]) => void\n  /** Legend placement; a single series shows none. */\n  legend?: \"top\" | \"bottom\" | \"none\"\n  /** Plot height in px, axes included. Horizontal charts default to a row height per category. */\n  height?: number\n  /** Row height per category in horizontal mode. */\n  rowHeight?: number\n  grid?: boolean\n  axis?: boolean\n  /** Space for the value ticks (vertical) or the category labels (horizontal), in px. */\n  axisWidth?: number\n  format?: Intl.NumberFormatOptions\n  locale?: string\n  formatValue?: (value: number) => string\n  formatTick?: (value: number) => string\n  /** Text for built-in controls and screen readers; pass translations here. */\n  labels?: Partial<BarChartLabels>\n}\n\nfunction useReduce() {\n  const prefers = useReducedMotion()\n  const [mounted, setMounted] = React.useState(false)\n  React.useEffect(() => setMounted(true), [])\n  return mounted && !!prefers\n}\n\nfunction useInView(ref: React.RefObject<Element | null>, threshold = 0.2) {\n  const [inView, setInView] = React.useState(false)\n  React.useEffect(() => {\n    const el = ref.current\n    if (!el || inView) return\n    if (typeof IntersectionObserver === \"undefined\") {\n      setInView(true)\n      return\n    }\n    const io = new IntersectionObserver(\n      ([e]) => {\n        if (e?.isIntersecting) {\n          setInView(true)\n          io.disconnect()\n        }\n      },\n      { threshold },\n    )\n    io.observe(el)\n    return () => io.disconnect()\n  }, [ref, inView, threshold])\n  return inView\n}\n\nfunction useWidth(ref: React.RefObject<HTMLElement | null>) {\n  const [width, setWidth] = React.useState<number | null>(null)\n  React.useLayoutEffect(() => {\n    const el = ref.current\n    if (!el) return\n    // A hidden parent (display:none) measures 0: keep the last real width instead of collapsing the chart.\n    const measure = () => {\n      const w = Math.round(el.clientWidth)\n      if (w > 0) setWidth(Math.max(120, w))\n    }\n    measure()\n    const ro = new ResizeObserver(measure)\n    ro.observe(el)\n    return () => ro.disconnect()\n  }, [ref])\n  return width\n}\n\nfunction niceTicks(lo: number, hi: number, count = 4): number[] {\n  if (hi <= lo) hi = lo + 1\n  const raw = (hi - lo) / count\n  const mag = 10 ** Math.floor(Math.log10(raw))\n  const norm = raw / mag\n  const step = (norm <= 1 ? 1 : norm <= 2 ? 2 : norm <= 2.5 ? 2.5 : norm <= 5 ? 5 : 10) * mag\n  const start = Math.floor(lo / step) * step\n  const end = Math.ceil(hi / step) * step\n  const ticks: number[] = []\n  for (let v = start; v <= end + step / 2; v += step) ticks.push(Number(v.toFixed(10)))\n  return ticks\n}\n\n/** Rounded rectangle with per-corner radii drawn with quadratic corners, so every bar shares one path template and morphs. */\nfunction rrect(x: number, y: number, w: number, h: number, tl: number, tr: number, br: number, bl: number) {\n  const m = Math.max(0, Math.min(w / 2, h / 2))\n  const a = Math.min(tl, m)\n  const b = Math.min(tr, m)\n  const c = Math.min(br, m)\n  const d = Math.min(bl, m)\n  const f = (v: number) => v.toFixed(1)\n  return `M${f(x + a)},${f(y)}H${f(x + w - b)}Q${f(x + w)},${f(y)} ${f(x + w)},${f(y + b)}V${f(y + h - c)}Q${f(x + w)},${f(y + h)} ${f(x + w - c)},${f(y + h)}H${f(x + d)}Q${f(x)},${f(y + h)} ${f(x)},${f(y + h - d)}V${f(y + a)}Q${f(x)},${f(y)} ${f(x + a)},${f(y)}Z`\n}\n\ntype Bar = { key: string; cat: number; x: number; y: number; w: number; h: number; from: string; to: string; color: string; value: number; label: string; dim: boolean }\n\n/** Grouped or stacked bars that grow from the baseline on view and morph on data changes, with a hover band, a legend and arrow-key scrubbing. */\nexport function BarChart({\n  series,\n  categories,\n  title,\n  mode = \"grouped\",\n  orientation = \"vertical\",\n  valueLabels = false,\n  barSize = 24,\n  radius = 4,\n  hidden: hiddenProp,\n  defaultHidden,\n  onHiddenChange,\n  legend = \"bottom\",\n  height: heightProp,\n  rowHeight = 34,\n  grid = true,\n  axis = true,\n  axisWidth,\n  format,\n  locale = \"en-US\",\n  formatValue,\n  formatTick,\n  labels,\n  className,\n  \"aria-label\": ariaLabel,\n  ...props\n}: BarChartProps) {\n  const l = useLabels(\"bar-chart\", DEFAULT_LABELS, labels)\n  const reduce = useReduce()\n  const rootRef = React.useRef<HTMLDivElement>(null)\n  const plotRef = React.useRef<HTMLDivElement>(null)\n  const inView = useInView(rootRef)\n  const width = useWidth(plotRef)\n  const [innerHidden, setInnerHidden] = React.useState<string[]>(defaultHidden ?? [])\n  const hidden = hiddenProp ?? innerHidden\n  const [hot, setHot] = React.useState<string | null>(null)\n  const [active, setActive] = React.useState<number | null>(null)\n\n  const horizontal = orientation === \"horizontal\"\n  const stacked = mode === \"stacked\"\n  const n = categories.length\n  const gap = 2\n  const colorOf = (s: BarSeries, i: number) => s.color ?? `var(--chart-${(i % 5) + 1})`\n  const visible = series.filter((s) => !hidden.includes(s.key))\n  const k = visible.length\n  const totals = categories.map((_, i) => visible.reduce((sum, s) => sum + Math.max(0, s.data[i] ?? 0), 0))\n  const all = stacked ? totals : visible.flatMap((s) => s.data.slice(0, n))\n  const min = Math.min(0, ...(all.length ? all : [0]))\n  const max = Math.max(0, ...(all.length ? all : [0]))\n  const ticks = niceTicks(min, max, 4)\n  const lo = ticks[0] ?? 0\n  const hi = ticks[ticks.length - 1] ?? 1\n  const fmt = React.useMemo(() => formatValue ?? ((v: number) => new Intl.NumberFormat(locale, format).format(v)), [formatValue, locale, format])\n  const tick = React.useMemo(() => {\n    if (formatTick) return formatTick\n    const compact = Math.max(Math.abs(hi), Math.abs(lo)) >= 10000\n    const f = new Intl.NumberFormat(locale, compact ? { ...format, notation: \"compact\", maximumFractionDigits: Math.max(1, format?.minimumFractionDigits ?? 0) } : format)\n    return (v: number) => f.format(v)\n  }, [formatTick, locale, format, hi, lo])\n\n  const W = width ?? 0\n  const padL = axis ? (axisWidth ?? (horizontal ? 96 : 44)) : 6\n  const padR = horizontal && valueLabels ? 56 : 10\n  const padT = !horizontal && valueLabels ? 20 : 12\n  const padB = axis ? 24 : 8\n  const height = heightProp ?? (horizontal ? n * rowHeight + padT + padB : 240)\n  const plotW = Math.max(10, W - padL - padR)\n  const plotH = Math.max(10, height - padT - padB)\n  // Value scale along y (vertical) or x (horizontal).\n  const span = hi - lo || 1\n  const vy = (v: number) => padT + (1 - (v - lo) / span) * plotH\n  const vx = (v: number) => padL + ((v - lo) / span) * plotW\n  const slot = horizontal ? plotH / Math.max(1, n) : plotW / Math.max(1, n)\n  const inner = slot * 0.72\n  const thick = stacked ? Math.min(barSize, inner) : Math.max(1, Math.min(barSize, (inner - (k - 1) * gap) / Math.max(1, k)))\n  const groupSize = stacked ? thick : k * thick + (k - 1) * gap\n  const catPos = (i: number) => (horizontal ? padT : padL) + i * slot + (slot - groupSize) / 2\n  const catCenter = (i: number) => (horizontal ? padT : padL) + i * slot + slot / 2\n  const base = horizontal ? vx(0) : vy(0)\n\n  const bars: Bar[] = []\n  categories.forEach((_cat, i) => {\n    let cum = 0\n    const topIndex = stacked ? visible.reduce((last, s, j) => (Math.max(0, s.data[i] ?? 0) > 0 ? j : last), -1) : -1\n    visible.forEach((s, j) => {\n      const v = s.data[i] ?? 0\n      const si = series.indexOf(s)\n      const color = colorOf(s, si)\n      const dim = hot !== null && hot !== s.key\n      if (stacked) {\n        const a = cum\n        const b = cum + Math.max(0, v)\n        cum = b\n        const isTop = j === topIndex\n        if (horizontal) {\n          const x0 = vx(a)\n          const x1 = vx(b)\n          const w = Math.max(0, x1 - x0 - (isTop ? 0 : gap))\n          const y = catPos(i)\n          const r = isTop ? radius : 0\n          bars.push({ key: `${s.key}-${i}`, cat: i, x: x0, y, w, h: thick, from: rrect(x0, y, 0, thick, 0, 0, 0, 0), to: rrect(x0, y, w, thick, 0, r, r, 0), color, value: v, label: s.label, dim })\n        } else {\n          const y1 = vy(b)\n          const y0 = vy(a)\n          const y = y1 + (isTop ? 0 : gap)\n          const h = Math.max(0, y0 - y)\n          const x = catPos(i)\n          const r = isTop ? radius : 0\n          bars.push({ key: `${s.key}-${i}`, cat: i, x, y, w: thick, h, from: rrect(x, y0, thick, 0, 0, 0, 0, 0), to: rrect(x, y, thick, h, r, r, 0, 0), color, value: v, label: s.label, dim })\n        }\n      } else if (horizontal) {\n        const x0 = Math.min(base, vx(v))\n        const x1 = Math.max(base, vx(v))\n        const y = catPos(i) + j * (thick + gap)\n        const pos = v >= 0\n        bars.push({ key: `${s.key}-${i}`, cat: i, x: x0, y, w: x1 - x0, h: thick, from: rrect(base, y, 0, thick, 0, 0, 0, 0), to: rrect(x0, y, x1 - x0, thick, pos ? 0 : radius, pos ? radius : 0, pos ? radius : 0, pos ? 0 : radius), color, value: v, label: s.label, dim })\n      } else {\n        const y0 = Math.min(base, vy(v))\n        const y1 = Math.max(base, vy(v))\n        const x = catPos(i) + j * (thick + gap)\n        const pos = v >= 0\n        bars.push({ key: `${s.key}-${i}`, cat: i, x, y: y0, w: thick, h: y1 - y0, from: rrect(x, base, thick, 0, 0, 0, 0, 0), to: rrect(x, y0, thick, y1 - y0, pos ? radius : 0, pos ? radius : 0, pos ? 0 : radius, pos ? 0 : radius), color, value: v, label: s.label, dim })\n      }\n    })\n  })\n\n  const catLabels: number[] = []\n  if (n > 0) {\n    const step = horizontal ? 1 : Math.max(1, Math.ceil(n / Math.max(2, Math.floor(plotW / 56))))\n    for (let i = 0; i < n; i += step) catLabels.push(i)\n  }\n\n  const name = typeof title === \"string\" ? title : \"\"\n  const summary = ariaLabel ?? (n && series.length ? l.summary(name, series.length, n) : l.noData)\n  const setHidden = (next: string[]) => {\n    if (hiddenProp === undefined) setInnerHidden(next)\n    onHiddenChange?.(next)\n  }\n  const indexAt = (clientX: number, clientY: number) => {\n    const rect = plotRef.current?.getBoundingClientRect()\n    if (!rect || n === 0) return null\n    const p = horizontal ? clientY - rect.top - padT : clientX - rect.left - padL\n    return Math.min(n - 1, Math.max(0, Math.floor(p / slot)))\n  }\n  const onKeyDown = (e: React.KeyboardEvent) => {\n    if (n === 0) return\n    if ([\"ArrowLeft\", \"ArrowRight\", \"ArrowUp\", \"ArrowDown\"].includes(e.key)) {\n      e.preventDefault()\n      const dir = e.key === \"ArrowLeft\" || e.key === \"ArrowUp\" ? -1 : 1\n      setActive((i) => Math.min(n - 1, Math.max(0, (i ?? (dir > 0 ? -1 : n)) + dir)))\n    } else if (e.key === \"Home\" || e.key === \"End\") {\n      e.preventDefault()\n      setActive(e.key === \"Home\" ? 0 : n - 1)\n    } else if (e.key === \"Escape\") setActive(null)\n  }\n\n  const ready = inView || reduce\n  // A container resize reshapes the bars at once; only data changes morph.\n  const widthRef = React.useRef(W)\n  const resized = widthRef.current !== W\n  widthRef.current = W\n  const spring = reduce || resized ? { duration: 0 } : springs.morph\n  const activeRows = active !== null ? visible.map((s) => ({ s, i: series.indexOf(s), v: s.data[active] ?? 0 })) : []\n  const activeCat = active !== null ? (categories[active] ?? \"\") : \"\"\n  const announce = active !== null ? l.point(activeCat, activeRows.map((r) => `${r.s.label}: ${fmt(r.v)}`).join(\", \") + (stacked ? `, ${l.total}: ${fmt(totals[active] ?? 0)}` : \"\")) : \"\"\n  const tipX = active !== null ? (horizontal ? padL + plotW * 0.5 : catCenter(active)) : 0\n  const tipY = active !== null ? (horizontal ? catCenter(active) : padT) : 0\n  const tipRight = tipX > W * 0.55\n\n  const legendNode =\n    legend !== \"none\" && series.length > 1 ? (\n      <ChartLegend items={series.map((s, i) => ({ key: s.key, label: s.label, color: colorOf(s, i) }))} hidden={hidden} onHiddenChange={setHidden} active={hot} onActiveChange={setHot} size=\"sm\" labels={{ legend: l.legend }} />\n    ) : null\n\n  return (\n    <div ref={rootRef} className={cn(\"pc-bar-chart flex w-full min-w-0 flex-col gap-2\", className)} {...props}>\n      <GooduiTokens />\n      {legend === \"top\" && legendNode}\n      <div\n        ref={plotRef}\n        role=\"group\"\n        aria-roledescription=\"bar chart\"\n        aria-label={summary}\n        tabIndex={0}\n        onPointerMove={(e) => setActive(indexAt(e.clientX, e.clientY))}\n        onPointerLeave={() => setActive(null)}\n        onFocus={() => setActive((i) => i ?? (n ? 0 : null))}\n        onBlur={() => setActive(null)}\n        onKeyDown={onKeyDown}\n        className=\"relative w-full touch-pan-y rounded-md outline-none focus-visible:ring-3 focus-visible:ring-ring/50\"\n        style={{ height }}\n      >\n        {width !== null && n > 0 && (\n          <svg width={W} height={height} viewBox={`0 0 ${W} ${height}`} className=\"absolute inset-0 overflow-visible\" aria-hidden=\"true\">\n            {active !== null && (\n              <motion.rect\n                className=\"fill-foreground\"\n                initial={false}\n                animate={horizontal ? { x: padL - 4, y: padT + active * slot, width: plotW + 8, height: slot } : { x: padL + active * slot, y: padT - 4, width: slot, height: plotH + 8 }}\n                transition={reduce ? { duration: 0 } : springs.snap}\n                rx={6}\n                style={{ opacity: 0.045 }}\n              />\n            )}\n            <AnimatePresence initial={false}>\n              {ticks.map((t) => (\n                <motion.g key={t} initial={{ opacity: 0, ...(horizontal ? { x: vx(t) } : { y: vy(t) }) }} animate={{ opacity: 1, ...(horizontal ? { x: vx(t) } : { y: vy(t) }) }} exit={{ opacity: 0 }} transition={spring}>\n                  {grid && (horizontal ? <line x1={0} x2={0} y1={padT} y2={padT + plotH} className=\"stroke-border\" /> : <line x1={padL} x2={padL + plotW} y1={0} y2={0} className=\"stroke-border\" />)}\n                  {axis &&\n                    (horizontal ? (\n                      <text x={0} y={height - 6} textAnchor=\"middle\" className=\"fill-muted-foreground text-[11px] tabular-nums\">\n                        {tick(t)}\n                      </text>\n                    ) : (\n                      <text x={padL - 8} y={0} dy=\".35em\" textAnchor=\"end\" className=\"fill-muted-foreground text-[11px] tabular-nums\">\n                        {tick(t)}\n                      </text>\n                    ))}\n                </motion.g>\n              ))}\n            </AnimatePresence>\n            {horizontal ? <line x1={base} x2={base} y1={padT} y2={padT + plotH} className=\"stroke-border\" /> : <line x1={padL} x2={padL + plotW} y1={base} y2={base} className=\"stroke-border\" />}\n            {bars.map((b, idx) => (\n              <motion.path\n                key={b.key}\n                d={ready ? b.to : b.from}\n                style={{ fill: b.color }}\n                initial={false}\n                animate={{ d: ready ? b.to : b.from, opacity: !ready ? 0 : b.dim ? 0.3 : active !== null && active !== b.cat ? 0.75 : 1 }}\n                transition={{ d: reduce ? { duration: 0 } : { ...spring, delay: b.cat * 0.035 + (idx % Math.max(1, k)) * 0.05 }, opacity: { duration: reduce ? 0 : 0.2 } }}\n              />\n            ))}\n            {valueLabels &&\n              categories.map((_, i) => {\n                const v = stacked ? (totals[i] ?? 0) : null\n                const items = stacked ? [{ v: v ?? 0, key: `t${i}`, pos: horizontal ? vx(v ?? 0) : vy(v ?? 0), off: catCenter(i) }] : bars.filter((b) => b.cat === i).map((b) => ({ v: b.value, key: b.key, pos: horizontal ? (b.value >= 0 ? b.x + b.w : b.x) : b.value >= 0 ? b.y : b.y + b.h, off: horizontal ? b.y + b.h / 2 : b.x + b.w / 2 }))\n                return items.map((it) => (\n                  <motion.text\n                    key={it.key}\n                    x={horizontal ? it.pos + (it.v >= 0 ? 6 : -6) : it.off}\n                    y={horizontal ? it.off : it.pos + (it.v >= 0 ? -6 : 14)}\n                    dy={horizontal ? \".35em\" : 0}\n                    textAnchor={horizontal ? (it.v >= 0 ? \"start\" : \"end\") : \"middle\"}\n                    className=\"fill-foreground text-[11px] font-medium tabular-nums\"\n                    initial={false}\n                    animate={{ opacity: ready ? 1 : 0 }}\n                    transition={reduce ? { duration: 0 } : { duration: 0.3, delay: 0.45 + i * 0.035 }}\n                  >\n                    {fmt(it.v)}\n                  </motion.text>\n                ))\n              })}\n            {axis &&\n              catLabels.map((i) =>\n                horizontal ? (\n                  <text key={i} x={padL - 8} y={catCenter(i)} dy=\".35em\" textAnchor=\"end\" className=\"fill-muted-foreground text-[11px]\">\n                    {categories[i]}\n                  </text>\n                ) : (\n                  <text key={i} x={catCenter(i)} y={height - 6} textAnchor=\"middle\" className=\"fill-muted-foreground text-[11px]\">\n                    {categories[i]}\n                  </text>\n                ),\n              )}\n          </svg>\n        )}\n        {width !== null && (n === 0 || series.length === 0) && <div className=\"absolute inset-0 grid place-items-center text-sm text-muted-foreground\">{l.noData}</div>}\n        {active !== null && activeRows.length > 0 && (\n          <div\n            className=\"pointer-events-none absolute z-10 flex min-w-32 flex-col gap-1 rounded-md border bg-popover px-2.5 py-1.5 text-xs text-popover-foreground shadow-[var(--pc-e2)]\"\n            style={{ left: tipX, top: tipY, transform: `translate(${tipRight ? \"calc(-100% - 12px)\" : \"12px\"}, ${horizontal ? \"-50%\" : \"0\"})` }}\n          >\n            <span className=\"text-muted-foreground\">{activeCat}</span>\n            {activeRows.map((r) => (\n              <span key={r.s.key} className=\"flex items-center gap-2 whitespace-nowrap\">\n                <span className=\"inline-block size-2 shrink-0 rounded-[2px]\" style={{ background: colorOf(r.s, r.i) }} />\n                <span className=\"flex-1 text-muted-foreground\">{r.s.label}</span>\n                <span className=\"font-semibold tabular-nums\">{fmt(r.v)}</span>\n              </span>\n            ))}\n            {stacked && activeRows.length > 1 && (\n              <span className=\"mt-0.5 flex items-center gap-2 border-t pt-1 whitespace-nowrap\">\n                <span className=\"flex-1 text-muted-foreground\">{l.total}</span>\n                <span className=\"font-semibold tabular-nums\">{fmt(totals[active] ?? 0)}</span>\n              </span>\n            )}\n          </div>\n        )}\n        <span className=\"sr-only\" aria-live=\"polite\">\n          {announce}\n        </span>\n      </div>\n      {legend === \"bottom\" && legendNode}\n      {n > 0 && series.length > 0 && (\n        <div className=\"sr-only\">\n          <table>\n          <caption>{summary}</caption>\n          <thead>\n            <tr>\n              <th scope=\"col\">{l.columnCategory}</th>\n              {series.map((s) => (\n                <th key={s.key} scope=\"col\">\n                  {s.label}\n                </th>\n              ))}\n              {stacked && series.length > 1 && <th scope=\"col\">{l.total}</th>}\n            </tr>\n          </thead>\n          <tbody>\n            {categories.map((c, i) => (\n              <tr key={i}>\n                <th scope=\"row\">{c}</th>\n                {series.map((s) => (\n                  <td key={s.key}>{fmt(s.data[i] ?? 0)}</td>\n                ))}\n                {stacked && series.length > 1 && <td>{fmt(series.reduce((sum, s) => sum + Math.max(0, s.data[i] ?? 0), 0))}</td>}\n              </tr>\n            ))}\n          </tbody>\n        </table>\n        </div>\n      )}\n    </div>\n  )\n}\n",
      "type": "registry:component",
      "target": "components/goodui/bar-chart.tsx"
    }
  ],
  "categories": [
    "components",
    "charts"
  ],
  "type": "registry:component"
}
