Radar

A radar draws one polygon per series around a shared set of spokes. Each spoke is a category. The distance from the center is the value. The shape is the comparison.

When to use it

Use a radar when several things are scored on the same spokes and the shape matters. Model comparison is a car and a bike on speed, handling, comfort, safety, range, and cost. The car reaches farther on comfort. The bike reaches farther on cost and handling. Team skills is one polygon: design is high, data is low.

A rose gives every category the same angle and maps one number to the radius. The sector is filled out to that value. It is a magnitude, not two profiles on the same spokes. A radial bar draws a bar on a track. The length is the radius, and several series sit side by side in the category, or stack outward.

A bar is the chart when the reader should rank one number per category on a straight axis. A radar wants a short list of spokes that share a scale. Model comparison has six. Fewer than three spokes does not draw.

Radar, rose, and radial bar

type: "radar" keeps the spokes fixed and draws a closed shape through the values. Two series are two polygons. They are not slices of a whole, and they do not sit side by side in a wedge.

type: "rose" encodes one value as the radius and keeps the angles equal. polarArea, nightingale, and rose-chart repair to rose. radar-chart and radar-beta repair to radar. The names are not interchangeable.

type: "radial-bar" is still a bar. The track, the hole, and mark.stack belong to that chart. A radar has no track and does not stack.

Data

Each row is one spoke. encoding.x is the spoke name. encoding.y is one field, or a list of fields for wide data. Model comparison uses spoke and the list car, bike. Team skills uses axis and score.

Spokes run in the order they first appear, starting at the top and going clockwise. A negative value is drawn at the center. The scale runs from zero to the largest value in the spec, unless a single encoding.y object sets scale.domain.

Long data uses one value field and encoding.series to split the rows into polygons. Model comparison is wide, so it does not set series.

a11y.alt is required. One sentence, 10 to 500 characters, with the point of the chart.

A spec that renders

This is the smallest radar. version, type, and a11y.alt are required. Three spokes and two series are enough to draw a comparison, so mark can be omitted. The polygons are filled. The names sit along the bottom.

spec.json
{
  "version": "1",
  "type": "radar",
  "data": [
    {
      "spoke": "Speed",
      "car": 4,
      "bike": 2
    },
    {
      "spoke": "Comfort",
      "car": 3,
      "bike": 5
    },
    {
      "spoke": "Cost",
      "car": 2,
      "bike": 4
    }
  ],
  "encoding": {
    "x": "spoke",
    "y": [
      "car",
      "bike"
    ]
  },
  "a11y": {
    "alt": "The bike leads on comfort and cost. The car leads on speed."
  }
}

Install core and the adapter for your framework. The menu in the sidebar picks the snippet. spec is the JSON above.

Import@chartkitdev/core/charts/radarBundle@chartkitdev/core/extraFamilyStatistical
React
npm install @chartkitdev/core
npm install @chartkitdev/react

import { Chart } from "@chartkitdev/react";

export function Panel() {
  return <Chart spec={spec} />;
}
Vanilla
npm install @chartkitdev/core
npm install @chartkitdev/vanilla

import { mount } from "@chartkitdev/vanilla";

const chart = mount(document.querySelector("#chart"), spec);
chart.update(spec);
Vue
npm install @chartkitdev/core
npm install @chartkitdev/vue

<script setup>
import { Chart } from "@chartkitdev/vue";
</script>

<template>
  <Chart :spec="spec" />
</template>
Svelte
npm install @chartkitdev/core
npm install @chartkitdev/svelte

<script>
  import { Chart } from "@chartkitdev/svelte";
</script>

<Chart {spec} />
Astro
npm install @chartkitdev/core
npm install @chartkitdev/astro

---
import { Chart } from "@chartkitdev/astro";
---

<Chart spec={spec} />
Solid
npm install @chartkitdev/core
npm install @chartkitdev/solid

import { Chart } from "@chartkitdev/solid";

export function Panel() {
  return <Chart spec={spec} />;
}
Qwik
npm install @chartkitdev/core
npm install @chartkitdev/qwik

import { component$ } from "@builder.io/qwik";
import { Chart } from "@chartkitdev/qwik";

export const Panel = component$(() => {
  return <Chart spec={spec} />;
});
Angular
npm install @chartkitdev/core
npm install @chartkitdev/angular

import { Component } from "@angular/core";
import { Chart } from "@chartkitdev/angular";

@Component({
  standalone: true,
  imports: [Chart],
  template: `<ck-chart [spec]="spec" />`,
})
export class Panel {
  spec = spec;
}
Custom element
npm install @chartkitdev/core
npm install @chartkitdev/element

import "@chartkitdev/element";

const chart = document.querySelector("chart-kit");
chart.spec = spec;

Radar ships in @chartkitdev/core/extra. Import it from @chartkitdev/core/charts/radar. createRenderer([line]) does not include it.

Each option below is a key on the spec. The demo changes that key and updates the chart and the snippet together.

Examples

Model comparison is the radar in the core examples and in the gallery: six spokes, car and bike. Team skills is the homepage chart, one series, with the legend turned off. The spokes are self-assessed scores.

Legend

A radar with two or more series draws the series names when legend is omitted. Those names sit along the bottom. legend: false hides them. legend.position right moves the list to the right. bottom is that same bottom list, written out.

legend.position
{
  "legend": { "position": "right" }
}

top is the shared legend default. On a radar it keeps the bottom names, so this control does not offer it. left and inside are in the playground. A position this control does not list leaves every button up.

Team skills is one series, so the names stay off the chart even when the key is omitted. The chart sets legend: false. The control still writes the key. The picture waits for a second series.

Tooltip

tooltip is on for a radar when the key is omitted. Hovering a polygon shows the series and the value on each spoke. tooltip: false turns the card off. tooltip: true turns it on.

tooltip false
{
  "tooltip": false
}
tooltip true
{
  "tooltip": true
}

tooltip.fields chooses the rows in the card, and tooltip.position places it. Change those in the playground. Turning the card off and on again puts that object back. An example that omitted tooltip gets the key removed, so the default stays on.

The rest of the spec

The polygon is filled at the theme's fill opacity, and the stroke is the series color. There is no mark.fill for a radar. mark.fillOpacity applies to lines, areas, and bars. On a radar it warns CK3010. The grid is four rings. mark.rings is a progress-ring key and does not change those rings. A score out of 100 sets encoding.y.scale.domain on a single series. Theme presets live on the playground, with the full option list.