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

Anatomie

Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.

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

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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
requis
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

Emplacements de contenu exposés par ce composant.

#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

Événements émis par ce composant.

@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.

Personnalisation

Variables CSS

Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.

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

Accessibilité

Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.

Rôles ARIA

figure
img
button

Interactions clavier

Interactions clavier
ToucheAction
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.

Fondation

Design tokens

Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.

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.

Interactif

Playground

Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.

Rendu de l’aperçu en cours…

Usage

Exemples

Extraits de code prêts à coller dans vos templates.

Weekly activity — nightingale rose

vue

With centre hole

vue