Skip to content
Domphy

chartRadarGridCircle

A Charts block/component from shadcn/ui — clean-room reimplemented for Domphy (see methodology). Call chartRadarGridCircle() with no arguments for a working demo, or edit the code below live.

Props

PropTypeDescription
dataRadarPoint[]
seriesRadarSeriesConfig[]
titlestring
descriptionstring
trendTextstring
trendDirectionChartTrendDirection
captionTextstring
showDotsboolean
Implementation notes

Circular ring grid with radial spokes kept (the one differentiator from chartRadarGrid, per spec) and corner dots on by default.

Status: ported · Reference: shadcn/ui original

// shadcn/ui "charts/radar-grid-circle" recipe — clean-room reimplementation.
//
// A single-series radar chart over a fully circular (ring) background grid
// while keeping the radial spoke lines, so the data polygon's straight
// hexagon silhouette contrasts against the round grid beneath it. Corner
// dots included by default. Hover tooltip shows the series color dot and
// "Desktop" label with the value, hiding only the month heading (hideLabel).
//
// Implemented purely from the block's public functional/visual spec — no
// upstream shadcn/ui source was viewed or copied.

import type { DomphyElement } from "@domphy/core";
import {
  type ChartTrendDirection,
  chartTrendFooter,
} from "./chart-area-shared.js";
import {
  createRadarTooltip,
  RADAR_MONTHLY_SINGLE_DATA,
  RADAR_SINGLE_SERIES,
  type RadarPoint,
  type RadarSeriesConfig,
  radarCardShell,
  renderRadarChart,
} from "./chart-radar-shared.js";

export interface ChartRadarGridCircleProps {
  data?: RadarPoint[];
  series?: RadarSeriesConfig[];
  title?: string;
  description?: string;
  trendText?: string;
  trendDirection?: ChartTrendDirection;
  captionText?: string;
  showDots?: boolean;
}

/**
 * shadcn/ui "charts/radar-grid-circle" recipe — a single-series radar chart
 * over a circular grid with spokes kept. Call with no arguments for a
 * working demo.
 */
function chartRadarGridCircle(
  props: ChartRadarGridCircleProps = {},
): DomphyElement<"div"> {
  const {
    data = RADAR_MONTHLY_SINGLE_DATA,
    series = RADAR_SINGLE_SERIES,
    title = "Radar Chart - Grid Circle",
    description = "Showing total visitors for the last 6 months",
    trendText = "Trending up by 5.2% this month",
    trendDirection = "up",
    captionText = "January - June 2026",
    showDots = true,
  } = props;

  const tooltip = createRadarTooltip();

  return radarCardShell({
    title,
    description,
    content: {
      div: [
        renderRadarChart({
          data,
          series,
          tooltip,
          gridShape: "circle",
          gridShowSpokes: true,
          showDots,
          dotRadius: 4,
          tooltipShowLabel: false,
          tooltipIndicator: "swatch",
        }),
      ],
    },
    footer: chartTrendFooter({
      trendText,
      direction: trendDirection,
      captionText,
    }),
  });
}

export { chartRadarGridCircle };

← Back to shadcn/ui catalog