Radar chart
A few things on the same measures, each an outline around one center.
On this page
A radar compares a few things on the same measures at a glance: two releases on six scores, a profile. Each series is an outline with a wash of the same color, so two show through each other. The measures share one scale, so give max when they have a known top. Point at a spoke to read every series on that measure.
Radar
<div class="card max-w(520) mx-auto"> <div class="card-header"> <h3 class="card-title">Releases</h3> <p class="card-description">2.4 against 2.3, out of 100</p> </div> <figure class="chart" id="releases" style="--chart-height: 15rem"></figure></div><script>addEventListener('DOMContentLoaded', function () {MasterUI.chart(document.getElementById('releases'), { type: 'radar', max: 100, label: 'Scores of two releases on six measures, out of 100', labels: ['Speed', 'Stability', 'Accessibility', 'Size', 'Docs', 'Security'], series: [ { name: '2.4', values: [82, 91, 74, 68, 88, 79] }, { name: '2.3', values: [70, 78, 81, 74, 62, 85] } ]})})</script><script type="module"> import { attach } from '@master/ui/behaviors' attach()</script>import { Chart } from './ui/chart'<div className="card max-w(520) mx-auto"> <div className="card-header"> <h3 className="card-title">Releases</h3> <p className="card-description">2.4 against 2.3, out of 100</p> </div> <Chart id="releases" style={{ '--chart-height': '15rem' } as React.CSSProperties} type="radar" max={100} label="Scores of two releases on six measures, out of 100" labels={['Speed', 'Stability', 'Accessibility', 'Size', 'Docs', 'Security']} series={[ { name: '2.4', values: [82, 91, 74, 68, 88, 79] }, { name: '2.3', values: [70, 78, 81, 74, 62, 85] } ]} /></div><script> import Chart from './ui/Chart.svelte'</script><div class="card max-w(520) mx-auto"> <div class="card-header"> <h3 class="card-title">Releases</h3> <p class="card-description">2.4 against 2.3, out of 100</p> </div> <Chart id="releases" style="--chart-height: 15rem" type="radar" max={100} label="Scores of two releases on six measures, out of 100" labels={['Speed', 'Stability', 'Accessibility', 'Size', 'Docs', 'Security']} series={[ { name: '2.4', values: [82, 91, 74, 68, 88, 79] }, { name: '2.3', values: [70, 78, 81, 74, 62, 85] } ]} /></div><script setup>import Chart from './ui/Chart.vue'</script><template> <div class="card max-w(520) mx-auto"> <div class="card-header"> <h3 class="card-title">Releases</h3> <p class="card-description">2.4 against 2.3, out of 100</p> </div> <Chart id="releases" style="--chart-height: 15rem" type="radar" :max="100" label="Scores of two releases on six measures, out of 100" :labels="['Speed', 'Stability', 'Accessibility', 'Size', 'Docs', 'Security']" :series="[ { name: '2.4', values: [82, 91, 74, 68, 88, 79] }, { name: '2.3', values: [70, 78, 81, 74, 62, 85] } ]" /> </div></template>A radar reads well with two or three series and five to eight measures. The exact scores belong in a table beside it.
#One series
A chart of one series is drawn in ink, and takes a color only when the series names a category.
One series
<div class="card max-w(520) mx-auto"> <div class="card-header"> <h3 class="card-title">Profile</h3> <p class="card-description">A review, out of 10</p> </div> <figure class="chart" id="profile" style="--chart-height: 15rem"></figure></div><script>addEventListener('DOMContentLoaded', function () {MasterUI.chart(document.getElementById('profile'), { type: 'radar', max: 10, ticks: 5, label: 'Scores of a review on five measures, out of 10', labels: ['Design', 'Code', 'Writing', 'Research', 'Speaking'], series: [{ name: 'Score', values: [9, 7, 8, 5, 6] }]})})</script><script type="module"> import { attach } from '@master/ui/behaviors' attach()</script>import { Chart } from './ui/chart'<div className="card max-w(520) mx-auto"> <div className="card-header"> <h3 className="card-title">Profile</h3> <p className="card-description">A review, out of 10</p> </div> <Chart id="profile" style={{ '--chart-height': '15rem' } as React.CSSProperties} type="radar" max={10} ticks={5} label="Scores of a review on five measures, out of 10" labels={['Design', 'Code', 'Writing', 'Research', 'Speaking']} series={[{ name: 'Score', values: [9, 7, 8, 5, 6] }]} /></div><script> import Chart from './ui/Chart.svelte'</script><div class="card max-w(520) mx-auto"> <div class="card-header"> <h3 class="card-title">Profile</h3> <p class="card-description">A review, out of 10</p> </div> <Chart id="profile" style="--chart-height: 15rem" type="radar" max={10} ticks={5} label="Scores of a review on five measures, out of 10" labels={['Design', 'Code', 'Writing', 'Research', 'Speaking']} series={[{ name: 'Score', values: [9, 7, 8, 5, 6] }]} /></div><script setup>import Chart from './ui/Chart.vue'</script><template> <div class="card max-w(520) mx-auto"> <div class="card-header"> <h3 class="card-title">Profile</h3> <p class="card-description">A review, out of 10</p> </div> <Chart id="profile" style="--chart-height: 15rem" type="radar" :max="10" :ticks="5" label="Scores of a review on five measures, out of 10" :labels="['Design', 'Code', 'Writing', 'Research', 'Speaking']" :series="[{ name: 'Score', values: [9, 7, 8, 5, 6] }]" /> </div></template>#Options
| Option | Default | |
|---|---|---|
label | none | What the chart shows and in what unit: the plot's accessible name |
labels | [] | The names along the scale, or around a radar |
series | [] | Each with a name and values, a value for a slice or a ring, or points for a scatter; optionally a category, a type and a ring's max |
min, max, ticks | fit, 4 | The ends of the scale and about how many steps mark it; xMin, xMax and xTicks for a scatter's scale across |
format, tickFormat | the locale's | How a value and a tick are written; xFormat for a scatter's scale across |
legend, toggle | with two series, true | Whether a legend is written, and whether its entries are checkboxes |
The readout, the keys, the legend, the colors and the scale are the same in every form: Chart holds them, with every option, class and custom property.