ChartPareto

Data Display
stable

Pareto chart combining vertical bars sorted descending by value with a cumulative percentage line on a secondary right Y-axis. Ideal for 80/20 rule and root-cause analysis.

Structure

Anatomy

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

Anatomy of OrigamChartParetoSchematic of the ChartPareto component with 8 numbered internal parts. origam-chart-pareto ① __header ② __body ③ __bar ④ __line ⑤ __line-dot ⑥ __axis--x ⑦ | __axis--y-left __axis--y-right ⑧ origam-chart-legend (grid-area: legend)
Anatomy of <origam-chart-pareto> — 8 internal parts. The SVG occupies __body; bars ④, line ⑤ and dots ⑥ are SVG children. Axes ⑦⑧ flank the plot area.
1.origam-chart-pareto
Root wrapper. CSS grid: header / body / legend rows.
2.origam-chart-pareto__header
Optional title + subtitle block (grid-area: header). Hidden when neither title nor subtitle is set.
3.origam-chart-pareto__body
Plot area (grid-area: body). Contains the SVG and the empty-state slot.
4.origam-chart-pareto__bar
One per datum, sorted descending. Keyboard-focusable (role="button", tabindex="0").
5.origam-chart-pareto__line
SVG tracing the cumulative percentage. Conditionally rendered when showLine=true.
6.origam-chart-pareto__line-dot
Circle markers on the cumulative line, one per bar centre.
7.origam-chart-pareto__axis--x
X-axis line + category tick marks and labels.
8.origam-chart-pareto__axis--y-left / --y-right
Left Y-axis (values) and right Y-axis (cumulative %). Conditionally rendered when showLine=true.

API

Props

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

barColor
'primary'
Colour of all bars. Accepts a TIntent token or a raw CSS colour.
lineColor
'danger'
Colour of the cumulative percentage line.
barGap
number
4
Gap in SVG pixels between adjacent bars.
showLine
boolean
true
Toggle the cumulative percentage line overlay.
showLabel
boolean
false
Show a value label above each bar.
showAxis
boolean
true
Render the X (category) and Y (value + %) axes.
showGrid
boolean
true
Render horizontal grid lines aligned with Y-axis ticks.
xAxisFormat
(value: string | number) => string
Formatter applied to X-axis category tick labels.
yAxisFormat
(value: number) => string
Formatter applied to the left Y-axis value tick labels.
cumulativeFormat
(value: number) => string
Formatter for the right Y-axis cumulative % ticks. Defaults to rounded integer, e.g. "80%".
series
required
Array<IChartSeries>
—
Data series. series[0].data must be an array of IChartParetoDatum ({ category, value }). Auto-sorted descending before rendering.
categories
Array<string>
[]
Optional category labels (fallback when data items lack a category field).
title
string
Optional title rendered above the chart area.
subtitle
string
Optional subtitle rendered below the title.
showLegend
boolean
true
Toggle the legend block showing bars and cumulative line entries.
legendPosition
TChartLegendPosition
'bottom'
Anchor of the legend block: top, bottom, left or right.
showTooltip
boolean
true
Toggle the hover tooltip.
animated
boolean
true
Animate bars and line on first paint. Respects prefers-reduced-motion.
animationDuration
number
600
Animation duration in milliseconds.
Palette used when a series does not pin its own colour.
aspectRatio
string
CSS aspect-ratio shortcut (e.g. "16/9"). Overrides height when set.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
height
number | string
360
Chart wrapper height. Accepts CSS length or number (→ px).
maxHeight
number | string
maxWidth
number | string
minHeight
number | string
minWidth
number | string
width
number | string
Chart wrapper width. Defaults to 100% of its container.
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. Receives the full bar descriptor including share and cumulative percentage.
#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 bar.
@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 axis labels).
Inner padding of the root wrapper.
Grid gap between header / body / legend rows.
Duration of bar grow and line-draw animations. Set via animationDuration prop.
Stroke colour of horizontal grid lines.
Stroke colour of axis lines and tick marks.
Font size of X/Y axis tick labels.
Stroke colour drawn between adjacent bars (typically the background).
Stroke width of the cumulative percentage line.

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 bars (tabindex="0" on each <rect>).
Enter / SpaceActivates the focused bar (fires point-click).

Notes

  • Root div carries role="figure" and aria-label from the title prop (or "Pareto chart" as fallback).
  • Inner SVG has role="img" with a <title> and <desc> element summarising the data count.
  • Each bar <rect> has aria-label describing its category, value, share (%) and cumulative (%).
  • 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.
color
var(--origam-color__border---default)
Axis line and tick mark colour.
color
var(--origam-color__border---subtle)
Grid line stroke 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.

Basic Pareto

vue

Bars only (no cumulative line)

vue