ChartPolarBar
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.
<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.
- innerRadiusnumber0.1
- Fraction of the total radius reserved as a centre hole. 0 = no hole, 1 = zero-thickness ring.
- startAnglenumber0
- Start angle in radians for the first wedge. 0 = 3 o'clock; -Math.PI/2 = 12 o'clock.
- gapnumber0.02
- Angular gap between consecutive wedges in radians. 0 = flush wedges.
- maxValuenumber
- Override the auto-computed maximum used to scale wedge outer radii. When omitted, max(series[0].data) is used.
- showLabelbooleantrue
- Render category labels outside the outer radius of each wedge.
- showValuebooleanfalse
- 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.
- seriesrequiredArray<IChartSeries>—
- Data series. series[0].data is an array of N numeric values, one per radial wedge.
- categoriesArray<string>[]
- Category labels for each wedge. Falls back to numeric index.
- titlestring
- Optional title rendered above the chart area.
- subtitlestring
- Optional subtitle rendered below the title.
- showLegendbooleantrue
- Toggle the legend block.
- legendPositionTChartLegendPosition'bottom'
- Anchor of the legend block: top, bottom, left or right.
- showTooltipbooleantrue
- Toggle the hover tooltip.
- animatedbooleantrue
- Animate wedges on first paint. Respects prefers-reduced-motion.
- animationDurationnumber600
- Animation duration in milliseconds.
- Palette cycled by wedge index when no per-series colour is set.
- aspectRatiostring
- CSS aspect-ratio shortcut. Overrides height when set.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- heightnumber | string
- Chart wrapper height. Accepts CSS length or number (→ px).
- maxHeightnumber | string
- maxWidthnumber | string
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | string
- marginboolean | number | string
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- paddingboolean | number | string
- paddingTopboolean | number | string
- paddingLeftboolean | number | string
- paddingBottomboolean | number | string
- paddingRightboolean | number | string
- paddingBlockboolean | number | string
- paddingInlineboolean | number | string
- paddingInlineStartboolean | number | string
- paddingInlineEndboolean | number | string
- paddingBlockStartboolean | number | string
- paddingBlockEndboolean | number | string
- roundedboolean | number | string | TRounded | null | undefined
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- elevationTElevation
- bgColor
- Background colour of the chart wrapper.
- fontSizeTFontSize
- fontWeightTFontWeight
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-clickIChartPoint, MouseEvent | KeyboardEvent
- Fired on mouse click or keyboard activation (Enter/Space) on a wedge.
- @legend-clickIChartSeries, number
- Fired when the user clicks a legend entry.
- @series-toggleIChartSeries, 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
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Moves focus between focusable wedges (tabindex="0" on each <path>). |
| Enter / Space | Activates 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.
- colorvar(--origam-color__surface---default)
- Chart wrapper background.
- colorvar(--origam-color__surface---inverse)
- Tooltip background colour.
- dimensionvar(--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
With centre hole