collab/mermaid/docs/syntax/radar.mdblame
View source
6dd74de1> **Warning**
6dd74de2>
6dd74de3> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
6dd74de4>
6dd74de5> ## Please edit the corresponding file in [/packages/mermaid/src/docs/syntax/radar.md](../../packages/mermaid/src/docs/syntax/radar.md).
6dd74de6
6dd74de7# Radar Diagram (v11.6.0+)
6dd74de8
6dd74de9## Introduction
6dd74de10
6dd74de11A radar diagram is a simple way to plot low-dimensional data in a circular format.
6dd74de12
6dd74de13It is also known as a **radar chart**, **spider chart**, **star chart**, **cobweb chart**, **polar chart**, or **Kiviat diagram**.
6dd74de14
6dd74de15## Usage
6dd74de16
6dd74de17This diagram type is particularly useful for developers, data scientists, and engineers who require a clear and concise way to represent data in a circular format.
6dd74de18
6dd74de19It is commonly used to graphically summarize and compare the performance of multiple entities across multiple dimensions.
6dd74de20
6dd74de21## Syntax
6dd74de22
6dd74de23```md
6dd74de24radar-beta
6dd74de25axis A, B, C, D, E
6dd74de26curve c1{1,2,3,4,5}
6dd74de27curve c2{5,4,3,2,1}
6dd74de28... More Fields ...
6dd74de29```
6dd74de30
6dd74de31## Examples
6dd74de32
6dd74de33```mermaid-example
6dd74de34---
6dd74de35title: "Grades"
6dd74de36---
6dd74de37radar-beta
6dd74de38 axis m["Math"], s["Science"], e["English"]
6dd74de39 axis h["History"], g["Geography"], a["Art"]
6dd74de40 curve a["Alice"]{85, 90, 80, 70, 75, 90}
6dd74de41 curve b["Bob"]{70, 75, 85, 80, 90, 85}
6dd74de42
6dd74de43 max 100
6dd74de44 min 0
6dd74de45```
6dd74de46
6dd74de47```mermaid
6dd74de48---
6dd74de49title: "Grades"
6dd74de50---
6dd74de51radar-beta
6dd74de52 axis m["Math"], s["Science"], e["English"]
6dd74de53 axis h["History"], g["Geography"], a["Art"]
6dd74de54 curve a["Alice"]{85, 90, 80, 70, 75, 90}
6dd74de55 curve b["Bob"]{70, 75, 85, 80, 90, 85}
6dd74de56
6dd74de57 max 100
6dd74de58 min 0
6dd74de59```
6dd74de60
6dd74de61```mermaid-example
6dd74de62radar-beta
6dd74de63 title Restaurant Comparison
6dd74de64 axis food["Food Quality"], service["Service"], price["Price"]
6dd74de65 axis ambiance["Ambiance"]
6dd74de66
6dd74de67 curve a["Restaurant A"]{4, 3, 2, 4}
6dd74de68 curve b["Restaurant B"]{3, 4, 3, 3}
6dd74de69 curve c["Restaurant C"]{2, 3, 4, 2}
6dd74de70 curve d["Restaurant D"]{2, 2, 4, 3}
6dd74de71
6dd74de72 graticule polygon
6dd74de73 max 5
6dd74de74
6dd74de75```
6dd74de76
6dd74de77```mermaid
6dd74de78radar-beta
6dd74de79 title Restaurant Comparison
6dd74de80 axis food["Food Quality"], service["Service"], price["Price"]
6dd74de81 axis ambiance["Ambiance"]
6dd74de82
6dd74de83 curve a["Restaurant A"]{4, 3, 2, 4}
6dd74de84 curve b["Restaurant B"]{3, 4, 3, 3}
6dd74de85 curve c["Restaurant C"]{2, 3, 4, 2}
6dd74de86 curve d["Restaurant D"]{2, 2, 4, 3}
6dd74de87
6dd74de88 graticule polygon
6dd74de89 max 5
6dd74de90
6dd74de91```
6dd74de92
6dd74de93## Details of Syntax
6dd74de94
6dd74de95### Title
6dd74de96
6dd74de97`title`: The title is an optional field that allows to render a title at the top of the radar diagram.
6dd74de98
6dd74de99```
6dd74de100radar-beta
6dd74de101 title Title of the Radar Diagram
6dd74de102 ...
6dd74de103```
6dd74de104
6dd74de105### Axis
6dd74de106
6dd74de107`axis`: The axis keyword is used to define the axes of the radar diagram.
6dd74de108
6dd74de109Each axis is represented by an ID and an optional label.
6dd74de110
6dd74de111Multiple axes can be defined in a single line.
6dd74de112
6dd74de113```
6dd74de114radar-beta
6dd74de115 axis id1["Label1"]
6dd74de116 axis id2["Label2"], id3["Label3"]
6dd74de117 ...
6dd74de118```
6dd74de119
6dd74de120### Curve
6dd74de121
6dd74de122`curve`: The curve keyword is used to define the data points for a curve in the radar diagram.
6dd74de123
6dd74de124Each curve is represented by an ID, an optional label, and a list of values.
6dd74de125
6dd74de126Values can be defined by a list of numbers or a list of key-value pairs. If key-value pairs are used, the key represents the axis ID and the value represents the data point. Else, the data points are assumed to be in the order of the axes defined.
6dd74de127
6dd74de128Multiple curves can be defined in a single line.
6dd74de129
6dd74de130```
6dd74de131radar-beta
6dd74de132 axis axis1, axis2, axis3
6dd74de133 curve id1["Label1"]{1, 2, 3}
6dd74de134 curve id2["Label2"]{4, 5, 6}, id3{7, 8, 9}
6dd74de135 curve id4{ axis3: 30, axis1: 20, axis2: 10 }
6dd74de136 ...
6dd74de137```
6dd74de138
6dd74de139### Options
6dd74de140
6dd74de141- `showLegend`: The showLegend keyword is used to show or hide the legend in the radar diagram. The legend is shown by default.
6dd74de142- `max`: The maximum value for the radar diagram. This is used to scale the radar diagram. If not provided, the maximum value is calculated from the data points.
6dd74de143- `min`: The minimum value for the radar diagram. This is used to scale the radar diagram. If not provided, the minimum value is `0`.
6dd74de144- `graticule`: The graticule keyword is used to define the type of graticule to be rendered in the radar diagram. The graticule can be `circle` or `polygon`. If not provided, the default graticule is `circle`.
6dd74de145- `ticks`: The ticks keyword is used to define the number of ticks on the graticule. It is the number of concentric circles or polygons drawn to indicate the scale of the radar diagram. If not provided, the default number of ticks is `5`.
6dd74de146
6dd74de147```
6dd74de148radar-beta
6dd74de149 ...
6dd74de150 showLegend true
6dd74de151 max 100
6dd74de152 min 0
6dd74de153 graticule circle
6dd74de154 ticks 5
6dd74de155 ...
6dd74de156```
6dd74de157
6dd74de158## Configuration
6dd74de159
6dd74de160Please refer to the [configuration](/config/schema-docs/config-defs-radar-diagram-config.html) guide for details.
6dd74de161
6dd74de162| Parameter | Description | Default Value |
6dd74de163| --------------- | ---------------------------------------- | ------------- |
6dd74de164| width | Width of the radar diagram | `600` |
6dd74de165| height | Height of the radar diagram | `600` |
6dd74de166| marginTop | Top margin of the radar diagram | `50` |
6dd74de167| marginBottom | Bottom margin of the radar diagram | `50` |
6dd74de168| marginLeft | Left margin of the radar diagram | `50` |
6dd74de169| marginRight | Right margin of the radar diagram | `50` |
6dd74de170| axisScaleFactor | Scale factor for the axis | `1` |
6dd74de171| axisLabelFactor | Factor to adjust the axis label position | `1.05` |
6dd74de172| curveTension | Tension for the rounded curves | `0.17` |
6dd74de173
6dd74de174## Theme Variables
6dd74de175
6dd74de176### Global Theme Variables
6dd74de177
6dd74de178> **Note**
6dd74de179> The default values for these variables depend on the theme used. To override the default values, set the desired values in the themeVariables section of the configuration:
6dd74de180>
6dd74de181> ---
6dd74de182>
6dd74de183> config:
6dd74de184> themeVariables:
6dd74de185> cScale0: "#FF0000"
6dd74de186> cScale1: "#00FF00"
6dd74de187>
6dd74de188> ---
6dd74de189
6dd74de190Radar charts support the color scales `cScale${i}` where `i` is a number from `0` to the theme's maximum number of colors in its color scale. Usually, the maximum number of colors is `12`.
6dd74de191
6dd74de192| Property | Description |
6dd74de193| ---------- | ------------------------------ |
6dd74de194| fontSize | Font size of the title |
6dd74de195| titleColor | Color of the title |
6dd74de196| cScale${i} | Color scale for the i-th curve |
6dd74de197
6dd74de198### Radar Style Options
6dd74de199
6dd74de200> **Note**
6dd74de201> Specific variables for radar resides inside the `radar` key. To set the radar style options, use this syntax.
6dd74de202>
6dd74de203> ---
6dd74de204>
6dd74de205> config:
6dd74de206> themeVariables:
6dd74de207> radar:
6dd74de208> axisColor: "#FF0000"
6dd74de209>
6dd74de210> ---
6dd74de211
6dd74de212| Property | Description | Default Value |
6dd74de213| -------------------- | ---------------------------- | ------------- |
6dd74de214| axisColor | Color of the axis lines | `black` |
6dd74de215| axisStrokeWidth | Width of the axis lines | `1` |
6dd74de216| axisLabelFontSize | Font size of the axis labels | `12px` |
6dd74de217| curveOpacity | Opacity of the curves | `0.7` |
6dd74de218| curveStrokeWidth | Width of the curves | `2` |
6dd74de219| graticuleColor | Color of the graticule | `black` |
6dd74de220| graticuleOpacity | Opacity of the graticule | `0.5` |
6dd74de221| graticuleStrokeWidth | Width of the graticule | `1` |
6dd74de222| legendBoxSize | Size of the legend box | `10` |
6dd74de223| legendFontSize | Font size of the legend | `14px` |
6dd74de224
6dd74de225## Example on config and theme
6dd74de226
6dd74de227```mermaid-example
6dd74de228---
6dd74de229config:
6dd74de230 radar:
6dd74de231 axisScaleFactor: 0.25
6dd74de232 curveTension: 0.1
6dd74de233 theme: base
6dd74de234 themeVariables:
6dd74de235 cScale0: "#FF0000"
6dd74de236 cScale1: "#00FF00"
6dd74de237 cScale2: "#0000FF"
6dd74de238 radar:
6dd74de239 curveOpacity: 0
6dd74de240---
6dd74de241radar-beta
6dd74de242 axis A, B, C, D, E
6dd74de243 curve c1{1,2,3,4,5}
6dd74de244 curve c2{5,4,3,2,1}
6dd74de245 curve c3{3,3,3,3,3}
6dd74de246```
6dd74de247
6dd74de248```mermaid
6dd74de249---
6dd74de250config:
6dd74de251 radar:
6dd74de252 axisScaleFactor: 0.25
6dd74de253 curveTension: 0.1
6dd74de254 theme: base
6dd74de255 themeVariables:
6dd74de256 cScale0: "#FF0000"
6dd74de257 cScale1: "#00FF00"
6dd74de258 cScale2: "#0000FF"
6dd74de259 radar:
6dd74de260 curveOpacity: 0
6dd74de261---
6dd74de262radar-beta
6dd74de263 axis A, B, C, D, E
6dd74de264 curve c1{1,2,3,4,5}
6dd74de265 curve c2{5,4,3,2,1}
6dd74de266 curve c3{3,3,3,3,3}
6dd74de267```
6dd74de268
6dd74de269<!--- cspell:ignore Kiviat --->