Polar Scatter Chart
The Polar Scatter Chart plots points on a circular grid, where each point's angle encodes one variable and its distance from the centre another — with an optional third variable driving marker size. It's ideal for directional data (wind, radar returns, cyclical measurements) where a cartesian scatter would misrepresent the wrap-around nature of the angle.
NOTE
For the full API, see the Charts API Reference.
Example
Usage
ts
import {
createPolarScatterChart,
} from '@ripl/charts';
const chart = createPolarScatterChart('#container', {
data: [
{ angle: 45,
speed: 62,
gust: 80 },
{ angle: 120,
speed: 34,
gust: 40 },
{ angle: 250,
speed: 88,
gust: 95 },
],
series: [
{ id: 'wind',
label: 'Wind',
angle: 'angle',
radius: 'speed',
sizeBy: 'gust' },
],
maxRadiusValue: 100,
});Data Format
Each item provides an angle (in degrees, 0° at the top and increasing clockwise), a radial value, and optionally a size value:
ts
const data = [
{ angle: 45,
speed: 62,
gust: 80 },
{ angle: 120,
speed: 34,
gust: 40 },
];Every series reads all rows through its own accessors. For multiple series, keep one row per observation and point each series at its own fields:
ts
const data = [
{ morningAngle: 60,
morningSpeed: 32,
eveningAngle: 250,
eveningSpeed: 78 },
];
const series = [
{ id: 'morning',
label: 'Morning',
angle: 'morningAngle',
radius: 'morningSpeed' },
{ id: 'evening',
label: 'Evening',
angle: 'eveningAngle',
radius: 'eveningSpeed' },
];Options
data— The data arrayseries— Array of series withid,label,angle(degrees accessor),radius(value accessor), optionalcolor,sizeBy,minRadius,maxRadiusmaxRadiusValue— Value mapped to the outer ring (defaults to the data maximum)levels— Number of concentric value rings (default4)angleTicks— Number of angular spokes/labels (default8)legend—boolean | ChartLegendOptions— Series legend (shown by default for multiple series)format— Value formatter for tooltips and ring labelspadding— Chart paddingtitle—string | ChartTitleOptions— Chart titleanimation—boolean | ChartAnimationOptions— Enable/configure animations