ChartsAlea Pro
ComboChart
Bars and lines on the same axes: amounts with a trend or a rate, like revenue and orders.
import { ComboChart } from '@alea/pro';
Examples
Bars and a line
Amounts as bars, the rate as a line on the same axis. Hover a legend item to bring its series forward.
Orders grew every month; revenue dipped in March.
- Revenue ($k)
- Orders
Tokens
The design tokens this component reads, with their value in the current theme. Override any of them to restyle it.
Color
--alea-border…--alea-focus…--alea-text-muted…
Type
--alea-font-family-body…
Motion
--alea-motion-duration-fast…--alea-motion-duration-slower…--alea-motion-ease-out…--alea-motion-spring…
Props
ComboChart props
Bars and lines on the same axes: amounts with a trend or a target (revenue and margin, visits and conversion).
| Prop | Type | Default | Description |
|---|---|---|---|
barsrequired | Series[] | - | Series drawn as bars. |
datarequired | ChartRow[] | - | |
linesrequired | Series[] | - | Series drawn as lines on top (same axis). |
xrequired | string | - | The key for the x axis. |
className | string | - | Extra class names for the root element. |
description | ReactNode | - | One sentence on what the data shows; read before the chart. |
height | number | 280 | Plot height in px. Default 280. |
isLoading | boolean | - | Shows a shimmering placeholder while data loads. |
showTable | boolean | true | Shows the table toggle. Default true. |
title | ReactNode | - | The title shown above it and read by screen readers. |
valueFormat | ((v: number) => string) | - | Formats values (axis, tooltip, table). |
Specs
Generated from the source: the variants in the types, the states and tokens in the CSS, and the motion patterns that apply. The grids render the real component in both themes; the numbers are measured from the page.
- States
- Keyboard focus
- Dark and light
- Every color comes from theme tokens, so it follows data-theme (and presets like Graphite) on the page or any wrapper. Contrast is checked in both themes.
- Styling hooks
.alea-chart-svgwrap.alea-chart-svg.alea-chart-grid.alea-chart-axis.alea-chart-bargroup.alea-chart-bar.alea-chart-line- Data attributes
data-dim
Accessibility
- The chart is a figure named by its title and described by its description; the picture has a text summary.
- Tab to the chart, then arrow keys move through the data and each value is announced; Escape leaves.
- The table toggle shows the same data as a real table for everyone who can't use the picture.
Keyboard
| Key | Does |
|---|---|
| Tab | Focuses the chart |
| Left or Right arrow | Previous or next value |
| Home or End | First or last value |
| Escape | Clears the selection |
Do and don't
Do
- Put the amount in bars and the rate or trend in the line.
- Label both axes when they measure different things.
Don't
- Don't use two axes to suggest a relation the data doesn't show.
- Don't put more than two series of each kind.