# Other Charts

- **Section:** Components
- **URL:** https://refast.fastapicloud.dev/docs/components/other-charts
- **Markdown:** https://refast.fastapicloud.dev/docs/components/other-charts.md
- **Source:** https://github.com/idling-mind/refast-docs/blob/main/docs/pages/components/charts/other_charts.py
- **Live examples:** the widgets on this page need a browser; open the URL above to try them.
- **Applies to:** refast 0.12.2

Beyond bar, line, area, and pie charts, Refast supports several specialised chart types
for specific data visualisation needs.

---

## Radar Chart

Radar charts (also called spider or web charts) show multivariate data on a 2D plane
with axes emanating from a common centre. Ideal for comparing entities across multiple
quantitative dimensions.

```python
from refast.components.shadcn.charts import (
    ChartContainer,
    RadarChart, Radar, PolarGrid, PolarAngleAxis,
    ChartTooltip, ChartTooltipContent,
)

data = [
    {"subject": "Python",     "score": 90},
    {"subject": "TypeScript", "score": 75},
    {"subject": "React",      "score": 80},
]

ChartContainer(class_name="h-72", children=[
    RadarChart(data=data, children=[
        PolarGrid(),
        PolarAngleAxis(data_key="subject"),
        ChartTooltip(content=ChartTooltipContent()),
        Radar(data_key="score", label="Score", fill_opacity=0.5),
    ]),
])
```

---

## Radial Bar Chart

Radial bar charts display values as arcs on a polar plane. They work well as
progress indicators or for comparing a small number of categories in a compact space.

```python
from refast.components.shadcn.charts import (
    ChartContainer,
    RadialBarChart, RadialBar,
    ChartTooltip, ChartTooltipContent,
)

# Add "fill" to each data item for per-bar colors
data = [
    {"name": "Design",      "value": 80,  "fill": "hsl(var(--chart-1))"},
    {"name": "Development", "value": 65,  "fill": "hsl(var(--chart-2))"},
    {"name": "Testing",     "value": 50,  "fill": "hsl(var(--chart-3))"},
]

ChartContainer(class_name="h-72", children=[
    RadialBarChart(data=data, inner_radius="20%", outer_radius="90%", bar_size=18,
        children=[
            RadialBar(data_key="value", background=True, corner_radius=4),
            ChartTooltip(content=ChartTooltipContent()),
        ],
    ),
])
```

> **Tip:** If no `"fill"` is present in any data item, colors are auto-assigned
> from the palette (`--chart-1`, `--chart-2`, …) in order.

---

## Scatter Chart

Scatter charts plot individual data points on X/Y axes, making it easy to spot
correlations, clusters, and outliers.

```python
from refast.components.shadcn.charts import (
    ChartContainer,
    ScatterChart, Scatter,
    XAxis, YAxis,
    ChartTooltip, ChartTooltipContent,
)

data = [
    {"x": 10, "y": 30},
    {"x": 40, "y": 60},
    {"x": 70, "y": 55},
]

ChartContainer(class_name="h-72", children=[
    ScatterChart(children=[
        XAxis(data_key="x", tick_line=False, axis_line=False),
        YAxis(data_key="y", tick_line=False, axis_line=False),
        ChartTooltip(content=ChartTooltipContent()),
        Scatter(name="Points", label="Points", data=data),
    ]),
])
```

---

## Component Reference

### RadarChart Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `data` | `list[dict]` | *(required)* | Array of data objects |
| `cx` | `str \| int` | `"50%"` | X centre position |
| `cy` | `str \| int` | `"50%"` | Y centre position |
| `outer_radius` | `int \| str` | `"80%"` | Outer radius |
| `start_angle` | `int` | `90` | Angle for the first axis |
| `end_angle` | `int` | `-270` | Angle sweep direction |

### Radar Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `data_key` | `str` | *(required)* | Key from data |
| `fill` | `str` | `"hsl(var(--chart-1))"` | Fill color |
| `fill_opacity` | `float` | `0.6` | Fill opacity |
| `stroke` | `str \| None` | *(same as fill)* | Stroke color |
| `stroke_width` | `int` | `2` | Stroke width |

### RadialBarChart Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `data` | `list[dict]` | *(required)* | Array of data objects |
| `inner_radius` | `int \| str` | `"10%"` | Inner radius |
| `outer_radius` | `int \| str` | `"80%"` | Outer radius |
| `bar_size` | `int \| None` | `None` | Fixed bar thickness |
| `start_angle` | `int` | `90` | Start angle |
| `end_angle` | `int` | `-270` | End angle |

### RadialBar Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `data_key` | `str` | *(required)* | Key for values |
| `background` | `bool \| dict` | `False` | Show background track arc |
| `corner_radius` | `int \| str \| None` | `None` | Rounded bar ends |
| `min_angle` | `int` | `0` | Minimum arc angle for zero values |
| `label` | `bool \| dict \| None` | `None` | Value labels |
| `fill` | `str` | `"hsl(var(--chart-1))"` | Default fill (overridden by `Cell`) |

### ScatterChart Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `data` | `list[dict] \| None` | `None` | Chart-level data (can also be set on `Scatter`) |
| `margin` | `dict` | `{top:20, right:20, left:20, bottom:20}` | Chart margins |
| `children` | `list` | `[]` | Axes, scatter series, tooltip |

### Scatter Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `data` | `list[dict] \| None` | `None` | Series-level data points |
| `fill` | `str` | `"hsl(var(--chart-1))"` | Point fill color |
| `shape` | `str` | `"circle"` | Point shape: `"circle"`, `"cross"`, `"diamond"`, `"square"`, `"star"`, `"triangle"`, `"wye"` |
| `name` | `str \| None` | `None` | Label for tooltip / legend |
| `line` | `bool \| dict` | `False` | Connect points with a line |

### Other Available Chart Types

| Component | Notes |
|-----------|-------|
| `ComposedChart` + `Bar`, `Line`, `Area` | Mix multiple series types in one chart |
| `FunnelChart` + `Funnel` | Funnel / pipeline visualisation |
| `Treemap` | Hierarchical area-proportioned rectangles |
| `Sankey` | Flow diagrams between nodes |

> These chart types follow the same `ChartContainer` wrapping pattern.
> Refer to the Recharts documentation for their full set of props.

---

Part of the Refast documentation: [all pages](https://refast.fastapicloud.dev/llms.txt), [everything on one page](https://refast.fastapicloud.dev/llms-full.txt), [search](https://refast.fastapicloud.dev/api/search?q=save_prop).
