export const title = "Radar chart components" export const description = "Powerful and customizable React radar chart components built for modern applications and websites. These radar charts are built using Recharts and styled with Tailwind CSS." export const links = { github: "https://github.com/untitleduico/react/tree/main/components/application/charts", recharts: "https://recharts.org/en-US/api/RadarChart", } import * as RadarCharts from "@/components/application/charts/radar-charts.story.tsx"; ## Installation You can add this radar chart component using our CLI or manually: ```bash npx untitledui@latest add charts-base ``` As our radar chart component is built with [Recharts](https://recharts.org/en-US/), you'll need to install the dependencies: ```bash npm install recharts ``` Copy the files below into your project: Great! Now you can start using the radar chart components in your project by just copy/pasting our examples below. ## Radar chart examples Below are examples and variations of this radar chart component: ### Radar chart {{ tocOnly:true }} ## API reference ` reads one numeric key through its own `dataKey`.", }, { question: "How do I add or remove series on a radar chart?", answer: "Each series is a single `` element inside the chart. Add one by adding another numeric key to every data object and rendering another ``; remove one by deleting its ``. The `name` prop is what appears in the legend and tooltip, so set it to the human-readable series title.", }, { question: "How do I change the colors of each radar series?", answer: "Colors come from Tailwind text utilities rather than hard-coded hex values. Each `` sets `stroke=\"currentColor\"` and `fill=\"currentColor\"` and takes its color from a class such as `text-utility-brand-600`, `text-utility-pink-500`, or `text-utility-sky-500` on `className`. Tune the fill translucency with `fillOpacity` (the example uses `0.2`) and the outline weight with `strokeWidth`.", }, { question: "Can I customize the radar chart tooltip?", answer: "Yes. The chart passes our styled `ChartTooltipContent` into the Recharts tooltip as `} />`. `ChartTooltipContent` accepts the standard Recharts tooltip props, including `formatter` and `labelFormatter`, so you can reformat values and labels without rewriting the markup. It lives in `charts-base.tsx` alongside `ChartLegendContent` and `ChartActiveDot`.", }, { question: "How do I customize the radar chart legend?", answer: "Render the Recharts `` with our `ChartLegendContent` as its `content`: ``. Placement is set on the `` element, not on `ChartLegendContent`. Recharts forwards `align` and `layout` to the content component, and `ChartLegendContent` reads only `align` and `layout` to decide its stacking and justification, and adds `reversed` to flip the payload order plus `className` for extra styling.", }, { question: "How do I control the value range of the radial axis?", answer: "Set the `domain` prop on `PolarRadiusAxis`, for example `domain={[0, 1000]}`, to pin the minimum and maximum of the rings instead of letting Recharts infer them. The same component takes `angle` to choose which spoke the tick labels sit on, `axisLine={false}` to hide the axis line, and a `tick` render function for fully custom tick labels.", }, { question: "How do I make the radar chart responsive?", answer: "Wrap the chart in the Recharts `` with `width=\"100%\"` and a fixed `height`, then set the chart's `cx`, `cy`, and `outerRadius` in percentages (`\"50%\"`, `\"50%\"`, and `\"80%\"` in our example) so the plot scales with its container.", }, ]} />