ChartPolar

Data Display
stable

Polar chart (pie / donut) with animated slices, interactive legend, tooltip, and optional drilldown navigation.

Aperçu

Rendu de l’aperçu en cours…

pie

Structure

Anatomie

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

Anatomy of OrigamChartPolarSchematic of the ChartPolar component with 6 internal parts. __header (title / subtitle) __legend (bottom by default) 1 2 3 4 5
Anatomy of <origam-chart-polar> — 5 internal parts. The SVG body hosts the pie/donut slices; the legend and tooltip sit outside the SVG.
1.origam-chart-polar
Root element. CSS Grid with named areas: header / breadcrumb / body / legend.
2.origam-chart-polar__header
Title + subtitle block. Rendered only when title or subtitle is set. Houses the #title slot.
3.origam-chart-polar__svg
SVG canvas. role="img" with <title> and for screen reader accessibility. Slices are keyboard-focusable elements with role="button".
4.origam-chart-polar__empty
Absolutely positioned empty state overlay. Shown when series is empty or all series are hidden.
5.origam-chart-polar__breadcrumb

API

Props

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.

type
TChartPolarKind
'pie'
Polar visualisation primitive. pie = filled slices; donut = ring with a centre hole.
donutHoleSize
number
0.6
Inner-radius fraction for type=donut. 0 = no hole, 1 = zero-thickness ring. Ignored for type=pie.
showTooltip
boolean
true
Toggle the hover tooltip.
xAxisFormat
(value: string | number) => string
Formatter applied to the tooltip X label (category name or index).
yAxisFormat
(value: number) => string
Formatter applied to the tooltip Y value.
drilldown
IChartDrilldownProps
Drilldown configuration. When provided, slices with a drilldown link trigger chart-level navigation with a breadcrumb nav.
series
requis
Array<IChartSeries>
—
Data series. Each series contains a name, optional color and a data array. Empty array renders the #empty slot.
categories
Array<string>
[]
Labels for each data point. Used in the legend and tooltip.
title
string
Optional chart title rendered above the plotting area.
subtitle
string
Optional subtitle rendered below the title.
showLegend
boolean
true
Toggle the legend block.
legendPosition
TChartLegendPosition
'bottom'
Anchor position of the legend relative to the chart body.
animated
boolean
true
Animate slices on first paint. Respects prefers-reduced-motion.
animationDuration
number
600
Animation duration in milliseconds.
Custom colour palette cycled across slices when a series has no pinned color.
aspectRatio
string
CSS aspect-ratio shortcut (e.g. "1/1"). When set, overrides the height prop.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
height
number | string
300
Chart container height. Accepts a CSS length or a 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 color of the chart container.
fontSize
TFontSize
fontWeight
TFontWeight

API

Slots

Emplacements de contenu exposés par ce composant.

#tooltip
Custom tooltip content. Receives the hovered point, series and category.
#legend-item
Custom legend item renderer.
#title
Replaces the default title/subtitle header block.
#empty
Shown when series is empty or all data is hidden. Defaults to "No data to display".

API

Emits

Événements émis par ce composant.

@drill
IChartDrilldownLink, IChartPoint
Fired when the user drills into a sub-dataset via a drilldown link.
@drill-up
void
Fired when the user navigates back one drilldown level.
@point-click
IChartPoint, MouseEvent | KeyboardEvent
Fired when a slice is clicked or activated via keyboard. Carries the point data and the triggering event.
@legend-click
IChartSeries, number
Fired when the user clicks a legend item.
@series-toggle
IChartSeries, boolean
Fired when a series visibility is toggled via the legend. Second arg is the next visible state.

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.

Gap between the header, body, and legend grid areas.
Padding of the root container.
Background color of the chart container.
Controls the slice fade-in animation duration. Set by the animationDuration prop.
Stroke color between pie/donut slices (gap line).
Stroke width between slices in SVG units.

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 across the interactive slices (each <path> has tabindex="0").
Enter / SpaceActivates the focused slice (fires point-click or triggers drilldown).

Notes

  • The SVG carries role="img" with a <title> and <desc> generated from the series data. Screen readers announce the chart as a single image with a summary.
  • Each slice has tabindex="0" and role="button" with an aria-label formatted as "{category}: {value}".
  • Slice 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
dimension
var(--origam-space---3)
Gap between grid areas (header / body / legend).
dimension
var(--origam-space---3)
Padding of the chart container.

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.

Pie chart

vue

Donut chart

vue

Écosystème

Famille

Composants du même dossier qui partagent les conventions et se composent souvent ensemble.