Appearance
Charts > Radar Chart
A radar chart is a graphical method of displaying multivariate data in the form of a two-dimensional chart, with three or more quantitative variables represented on axes starting from the same point.
The Chart
Value:
Download example CSV
Copy HTML
Playground
Data
Number of shapes
Number of axes
Number of lines on each axis
Animation
Total time of animation in ms
Style
Color for each shape
Fill opacity of shape
Show values in axis labels
Usage Example (with tooltip)
vue
<template>
<RadarChart :data="data" @hover="setTooltip" />
<OTTooltip :info="tooltip">
<div class="">
<p class=" my-0">
<span class="font-semibold">Value: </span>{{ tooltip?.data?.value }}
</p>
</div>
</OTTooltip>
</template>
<script setup>
import useTooltip from "@/functions/useTooltip.js";
const [tooltip, setTooltip] = useTooltip();
</script>Component API
The radar chart is built with SVG and d3. The shape animates using d3 transition.
Data
js
[
{ name: "Axis 1", value: 10 },
{ name: "Axis 2", value: 30 },
...
]<Props
| Name | Default | Description | Type |
|---|---|---|---|
| numShapes | 1 | The number of shapes we want | Number |
| data | "[]" | The dataset | Array |
| levels | "[10, 20, 30, 40, 50]" | The values for the grid lines | Array |
| gridColor | "#D1D5DB" | The color for the background grid | String |
| shapeColors | "#D61355,#30E3DF,#68B984" | The colors for the shapes | String |
| margin | 20 | The margin around the chart | Number |
| labelColor | "#4B5563" | The text color for labels | String |
| labelFactor | 1.2 | The higher the value, the more distance between chart and labels | Number |
| opacity | 0 | The opacity of the shapes | Number |
| unit | "" | The unit for axis labels | String |
| rotation | 0 | The rotation of the chart in radians | Number |
| showValues | false | Whether or not to show the value of each axis next to the name | Boolean |
Dependencies
- d3