Radial Bar Chart
The Radial Bar Chart lays each category out as a concentric ring whose arc length encodes its value — a circular take on the bar chart that reads well for a handful of comparable metrics or progress-style values. Each ring has a faint track behind a colored value arc that sweeps clockwise from the top.
NOTE
For the full API, see the Charts API Reference.
Example
Usage
ts
import {
createRadialBarChart,
} from '@ripl/charts';
const chart = createRadialBarChart('#container', {
data: [
{ language: 'JavaScript',
share: 92 },
{ language: 'Python',
share: 78 },
{ language: 'Rust',
share: 61 },
],
key: 'language',
value: 'share',
maxValue: 100,
format: v => `${v}%`,
});Data Format
Each item provides a category key and a numeric value:
ts
const data = [
{ language: 'JavaScript',
share: 92 },
{ language: 'Python',
share: 78 },
];Options
data— The data arraykey— Category accessor (a field name or a function)value— Numeric value accessor; encoded as the arc lengthlabel— Optional label accessor (defaults tokey)color— Optional per-category color accessormaxValue— Value mapped to a full sweep (defaults to the data maximum)innerRadius— Inner hole radius as a ratio of the chart size (default0.2)range— Angular sweep of a full-value bar in degrees (default360)gap— Gap between rings as a ratio of ring thickness (default0.25)rounded— Round the ends of each value bar and its track (defaultfalse)trackColor— Background track colorlegend—boolean | ChartLegendOptions— Category legendformat— Value formatter for tooltipspadding,title,animation— Standard chart options