ChartPolar

Data Display
stable

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

Preview

Rendering the live preview…

pie

Structure

Anatomy

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

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

All props accepted by this component, with their type, default value and 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
required
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

Content slots exposed by this component.

#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

Events emitted by this component.

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

Customisation

CSS variables

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

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

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

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
dimension
var(--origam-space---3)
Gap between grid areas (header / body / legend).
dimension
var(--origam-space---3)
Padding of the chart container.

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.

Pie chart

vue

Donut chart

vue

Ecosystem

Family

Components from the same folder that share conventions and often compose together.