Angular Proximity Chart
The proximity chart puts one item in the middle and arranges the others around it. Each item's value sets how close to the center it sits. That value can measure how similar an item is to the center, or how far away it is. The chart answers "what's closest to this?" at a glance. Any item, including the center, can be drawn as an image.
Try it
Cities ranked by how similar their climate is to Portland's, using made-up scores from 0 to 1. The controls below change the chart's config as you use them. The Configuration table explains each setting.
at 90%, 80%, 70%, and 60%28px
Climates like Portland's
Change the settings above and it redraws.
const config: PcacProximityChartConfig = {
center: { key: 'Portland', value: null, hide: false, data: [] },
// Closest first: the first item sits at 12 o'clock, and the rest go clockwise.
data: [
{ key: 'Seattle', value: 0.96, hide: false, data: [] },
{ key: 'Vancouver', value: 0.94, hide: false, data: [] },
...
],
closeValue: 1, // identical: right next to the center
farValue: 0.5, // on the outer edge
format: PcacFormatEnum.Percentage,
showLabels: true,
rings: [0.9, 0.8, 0.7, 0.6],
itemSize: 28,
centerSize: 44,
};Markup
<pcac-proximity-chart [config]="config" (itemClicked)="onClicked($event)" />
API
import { PcacProximityChart, PcacProximityChartConfig } from '@pioneer-code/pioneer-charts';Configuration
| Name | Description |
|---|---|
| data | Collection of PcacData objects. |
| height | Height of chart component. Default is 200px. |
| ariaLabel | What the chart shows, for screen readers — e.g. 'Sales by month, 2026'. The chart is announced as a group with this name, and each bar, slice or point inside it by its own key and value (see Accessibility). When omitted, its type is used: 'Bar chart', 'Pie chart', 'Line chart' and so on. |
| heightFull | If true, height is treated as a minimum height and the chart grows to fill its container whenever that container is taller. Default is false.
|
| center | The item the others are compared to, drawn in the middle. It needs a key (its name) and can have an image. Its value isn't used. |
| closeValue / farValue | closeValue is the value that puts an item right next to the center, and farValue puts it on the outer edge. Values in between are spaced proportionally, and values past either end stay at that end. The defaults are 1 and 0, which fit a similarity score from 0 to 1. For a distance, flip them: closeValue: 0, farValue: <largest distance>. |
| rings | Values at which to draw a faint dashed guide ring. Each ring is labeled using format. No rings are drawn if this is left out. |
| format | How values are shown on the ring labels, in the tooltip, and to screen readers, the same as on an axis. For example, Percentage. |
| showLabels | Shows each item's key below it, including the center's. Default false. The names appear in the tooltip either way. Leave it off when the names are long or the ring is crowded. |
| showSpokes | Draws a faint line from the center to each item. Default true. |
| startAngle | Where the first item sits, in degrees clockwise from 12 o'clock. Default 0. Items are spaced evenly and go clockwise in data order, so list the closest item first to put it at the top. |
| centerSize / itemSize | The size, in pixels, of the center's image (or its dot's diameter) and of each item's. The defaults are 64 and 40. The chart works best with a few items up to about a dozen. With more than that, they start to crowd each other around the ring. |
| colorOverride | Dot colors for items that don't have an image, used in place of the theme palette. Any CSS color works. The center gets the first color, then the items get the rest in data order. If there are more items than colors, the colors repeat. |
Events
| Binding | Description | Payload |
|---|---|---|
| (itemClicked)="onClicked($event)" | Emitted when an item or the center is clicked, or when it has focus and the user presses Enter or Space. It sends a copy of the item. Give the item an id so you can match it back to your own record (see Data Contract). | PcacData |