ChartPolarBar

Data Display
stable

Nightingale-rose (polar bar) chart. N data points are rendered as radial wedges each occupying an equal angular slice; outer radius is proportional to value. Ideal for cyclical data such as hours per day or monthly activity.

Structure

Anatomy

Visual breakdown of the component's internal structure with BEM class call-outs.

Anatomy of OrigamChartPolarBarSchematic of the ChartPolarBar component with 6 numbered internal parts. origam-chart-polar-bar ① __header ② __body ③ origam-chart__polar-bar-wedge ④ --active modifier on hover __polar-bar-category-label ⑤ __polar-bar-value-label ⑥ origam-chart-legend
Anatomy of <origam-chart-polar-bar> — 6 internal parts. Wedges ④ are SVG <path> elements inside a centred <g>. Category labels ⑤ and optional value labels ⑥ float outside / inside the outer radius.
1.origam-chart-polar-bar
Root wrapper. CSS grid: header / body / legend rows.
2.origam-chart-polar-bar__header
Optional title + subtitle block.
3.origam-chart-polar-bar__body
Plot area containing the SVG and empty-state slot.
4.origam-chart__polar-bar-wedge
SVG arc for one data point. Keyboard-focusable (role="button", tabindex="0"). Gets --active modifier on hover.
5.origam-chart__polar-bar-category-label
Category text anchored outside the outer radius. text-anchor driven by wedge midpoint quadrant.
6.origam-chart__polar-bar-value-label
Optional numeric value label inside the wedge. Hidden when angular space is insufficient (showValueLabel flag).

API

Props

All props accepted by this component, with their type, default value and description.

innerRadius
number
0.1
Fraction of the total radius reserved as a centre hole. 0 = no hole, 1 = zero-thickness ring.
startAngle
number
0
Start angle in radians for the first wedge. 0 = 3 o'clock; -Math.PI/2 = 12 o'clock.
gap
number
0.02
Angular gap between consecutive wedges in radians. 0 = flush wedges.
maxValue
number
Override the auto-computed maximum used to scale wedge outer radii. When omitted, max(series[0].data) is used.
showLabel
boolean
true
Render category labels outside the outer radius of each wedge.
showValue
boolean
false
Render the numeric value label inside the wedge when there is sufficient angular room.
xAxisFormat
(value: string | number) => string
Formatter applied to tooltip X label (category name or index).
yAxisFormat
(value: number) => string
Formatter applied to tooltip Y value and the in-wedge value label.
series
required
Array<IChartSeries>
—
Data series. series[0].data is an array of N numeric values, one per radial wedge.
categories
Array<string>
[]
Category labels for each wedge. Falls back to numeric index.
title
string
Optional title rendered above the chart area.
subtitle
string
Optional subtitle rendered below the title.
showLegend
boolean
true
Toggle the legend block.
legendPosition
TChartLegendPosition
'bottom'
Anchor of the legend block: top, bottom, left or right.
showTooltip
boolean
true
Toggle the hover tooltip.
animated
boolean
true
Animate wedges on first paint. Respects prefers-reduced-motion.
animationDuration
number
600
Animation duration in milliseconds.
Palette cycled by wedge index when no per-series colour is set.
aspectRatio
string
CSS aspect-ratio shortcut. Overrides height when set.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
height
number | string
Chart wrapper height. Accepts CSS length or number (→ px).
maxHeight
number | string
maxWidth
number | string
minHeight
number | string
minWidth
number | string
width
number | string
margin
boolean | number | string
marginTop
boolean | number | string
marginLeft
boolean | number | string
marginBottom
boolean | number | string
marginRight
boolean | number | string
marginBlock
boolean | number | string
marginInline
boolean | number | string
marginInlineStart
boolean | number | string
marginInlineEnd
boolean | number | string
marginBlockStart
boolean | number | string
marginBlockEnd
boolean | number | string
padding
boolean | number | string
paddingTop
boolean | number | string
paddingLeft
boolean | number | string
paddingBottom
boolean | number | string
paddingRight
boolean | number | string
paddingBlock
boolean | number | string
paddingInline
boolean | number | string
paddingInlineStart
boolean | number | string
paddingInlineEnd
boolean | number | string
paddingBlockStart
boolean | number | string
paddingBlockEnd
boolean | number | string
rounded
boolean | number | string | TRounded | null | undefined
roundedTopRight
boolean | number | string
roundedTopLeft
boolean | number | string
roundedBottomLeft
boolean | number | string
roundedBottomRight
boolean | number | string
roundedStartStart
boolean | number | string
roundedStartEnd
boolean | number | string
roundedEndStart
boolean | number | string
roundedEndEnd
boolean | number | string
elevation
TElevation
bgColor
Background colour of the chart wrapper.
fontSize
TFontSize
fontWeight
TFontWeight

API

Slots

Content slots exposed by this component.

#tooltip
Replace the default tooltip body. Receives the hovered point, the category label, and the pre-computed percentage string.
#legend-item
Replace one legend entry with custom content.
#title
Replace the default title + subtitle block.
#empty
Rendered when series is empty or all series have no data.

API

Emits

Events emitted by this component.

@point-click
IChartPoint, MouseEvent | KeyboardEvent
Fired on mouse click or keyboard activation (Enter/Space) on a wedge.
@legend-click
IChartSeries, number
Fired when the user clicks a legend entry.
@series-toggle
IChartSeries, boolean
Resulting visibility flip after a legend click.

Customisation

CSS variables

CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.

Background colour of the chart wrapper.
Default text colour (inherited by category labels).
Inner padding of the root wrapper.
Grid gap between header / body / legend rows.
Wedge animation duration. Set via animationDuration prop.
Tooltip background colour.

Inclusion

Accessibility

ARIA roles, keyboard navigation and focus management. Sourced from the real component template.

ARIA roles

figure
img
button

Keyboard interactions

Keyboard interactions
KeyAction
TabMoves focus between focusable wedges (tabindex="0" on each <path>).
Enter / SpaceActivates the focused wedge (fires point-click).

Notes

  • Root div carries role="figure" and aria-label from the title prop (or "Polar bar chart").
  • Inner SVG has role="img" with <title> and <desc> elements summarising the data.
  • Each wedge <path> has aria-label with category, value, percentage and series name.
  • All CSS animations are disabled under prefers-reduced-motion: reduce.

Foundation

Design tokens

Excerpt from this component's token declarations — the --origam-<component>---<property> variables, declared in its hand-maintained token sheet with no build step.

Source
color
var(--origam-color__surface---default)
Chart wrapper background.
color
var(--origam-color__surface---inverse)
Tooltip background colour.
dimension
var(--origam-space---3)
Gap between legend items.

Interactive

Playground

Edit props live and see the component update in real time. The generated code snippet updates as you change values.

Rendering the live preview…

Usage

Examples

Ready-to-paste code snippets for your templates.

Weekly activity — nightingale rose

vue

With centre hole

vue