MekkoChart
Show sequence, schedule or attribution over rows you prepared.
@luc/ui/chartsWhat it shows
Show composition and group size together: column width carries the group's weight and segments carry the mix.
Live preview
Column width is the group's size, so equal percentages inside unequal columns read as the different facts they are.
<MekkoChart
columns={[
{
label: "EMEA",
weight: 48,
segments: [
{ name: "Net new", value: 26 },
{ name: "Expansion", value: 15 },
{ name: "Churn", value: 7 },
],
},
{
label: "Americas",
weight: 72,
segments: [
{ name: "Net new", value: 41 },
{ name: "Expansion", value: 19 },
{ name: "Churn", value: 12 },
],
},
{
label: "APAC",
weight: 24,
segments: [
{ name: "Net new", value: 15 },
{ name: "Expansion", value: 6 },
{ name: "Churn", value: 3 },
],
},
]}
format={{ kind: "number", decimals: 0, suffix: "m" }}
height={340}
ariaLabel="Revenue mix by region"
/>Controls
Height
A chart measures its container, so it always needs a definite height.
State
The surface the chart is in — loading, empty and error are drawn by the component.
Accessible name
A drawing is not readable by a screen reader, so it needs a name that states what it shows.
The same fixture as the live preview above; the controls change how it is drawn, not what it measures.
Code
import { MekkoChart } from "@luc/ui/charts";
<MekkoChart
columns={[
{
label: "EMEA",
weight: 48,
segments: [
{ name: "Net new", value: 26 },
{ name: "Expansion", value: 15 },
{ name: "Churn", value: 7 },
],
},
{
label: "Americas",
weight: 72,
segments: [
{ name: "Net new", value: 41 },
{ name: "Expansion", value: 19 },
{ name: "Churn", value: 12 },
],
},
{
label: "APAC",
weight: 24,
segments: [
{ name: "Net new", value: 15 },
{ name: "Expansion", value: 6 },
{ name: "Churn", value: 3 },
],
},
]}
format={{ kind: "number", decimals: 0, suffix: "m" }}
height={340}
ariaLabel="Revenue mix by region"
state="ready"
/>Not controllable here
series / rows— The numbers are the caller's; the fixture above is the example.
Copy for an AI agentA specification an agent can act on: the import, the setup, the chosen props, the data contract and the accessibility expectation.
Implement `MekkoChart` from Luc UI. It is: Show sequence, schedule or attribution over rows you prepared.
Import it with: import { MekkoChart } from "@luc/ui/charts";
Requires: react ^19.0.0; react-dom ^19.0.0; react-hook-form ^7.0.0 (optional, for @luc/ui/forms/react-hook-form); tailwindcss ^4.0.0; node >= 22 (repository tools). Import the stylesheet once at the app root and wrap the tree in `LucProvider`. Both come from the package that publishes @luc.
Chosen configuration: `height={340}`, `state="ready"`, `ariaLabel="Revenue mix by region"`.
Accessibility: keep the component's own semantics. Do not re-implement its ARIA wiring, do not add roles it does not declare, and make sure every interactive element is reachable and operable from the keyboard with a visible focus state.
Styling: use Luc UI design tokens and the component's own props. Do not restyle with raw colour literals and do not override the component's internal structure with page CSS.
Motion: respect `prefers-reduced-motion`. The component already does, so do not disable it.
Reproduce this state:
```tsx
<MekkoChart
columns={[
{
label: "EMEA",
weight: 48,
segments: [
{ name: "Net new", value: 26 },
{ name: "Expansion", value: 15 },
{ name: "Churn", value: 7 },
],
},
{
label: "Americas",
weight: 72,
segments: [
{ name: "Net new", value: 41 },
{ name: "Expansion", value: 19 },
{ name: "Churn", value: 12 },
],
},
{
label: "APAC",
weight: 24,
segments: [
{ name: "Net new", value: 15 },
{ name: "Expansion", value: 6 },
{ name: "Churn", value: 3 },
],
},
]}
format={{ kind: "number", decimals: 0, suffix: "m" }}
height={340}
ariaLabel="Revenue mix by region"
state="ready"
/>
```Usage
The values are prepared by the caller: this component draws the points it is given and computes no statistic of its own, so units, scaling and any summary have to be settled before the data reaches it.
It is drawn by the ECharts engine.
Worked examples with real data are on the family overview: Workflow & operations
import { MekkoChart } from "@luc/ui/charts";<MekkoChart
columns={[
{
label: "EMEA",
weight: 48,
segments: [
{ name: "Net new", value: 26 },
{ name: "Expansion", value: 15 },
{ name: "Churn", value: 7 },
],
},
{
label: "Americas",
weight: 72,
segments: [
{ name: "Net new", value: 41 },
{ name: "Expansion", value: 19 },
{ name: "Churn", value: 12 },
],
},
{
label: "APAC",
weight: 24,
segments: [
{ name: "Net new", value: 15 },
{ name: "Expansion", value: 6 },
{ name: "Churn", value: 3 },
],
},
]}
format={{ kind: "number", decimals: 0, suffix: "m" }}
height={340}
ariaLabel="Revenue mix by region"
/>Data contract
`columns` contain a `label`, numeric `weight` and `segments` of `{ name, value }`; segment values must be comparable within a column. The chart does not compute shares.
Important configuration
State the weight unit, keep segment order consistent, and use `format` for the measure rather than relying on the visual height alone.
Guidelines
When not to use
Do not use a Mekko chart when column weights are not meaningful or when segments cannot be compared on one scale.
Configuration
| Export | Kind | Signature |
|---|---|---|
MekkoChart | 12 documented props | ({ columns, format, title, description, state, height, className, ariaLabel, ariaDescription, onReady, onEvent, eager, }: MekkoChartProps) => import("@types/react").JSX.Element |
MekkoChart props
Type: MekkoChartProps
Values the compiler reads from the declaration.
| Prop | Type | Default | Notes |
|---|---|---|---|
ariaDescription? | string | undefined | — | |
ariaLabel? | string | undefined | — | |
className? | string | undefined | — | |
columns | readonly MekkoColumn[] | — | |
description? | string | undefined | — | |
eager? | boolean | undefined | — | Create the engine on mount rather than when the surface is approached. |
format? | ChartFormat | undefined | — | |
height? | string | number | undefined | — | |
onEvent? | ((event: EChartEvent) => void) | undefined | — | |
onReady? | ((chart: EChartsInstance) => void) | undefined | — | |
state? | ChartState | undefined | — | |
title? | string | undefined | — |
Accessibility
A chart is a picture of data, so it needs a name that states what it shows, and the numbers must exist as text somewhere on the page — in a table or a written summary — because a drawing is not readable by a screen reader and cannot be copied.
What happens on the server, and when hydration changes it.
Family
Workflow & operations
Sequence, schedule, comparison and attribution.
Related