---
title: "Highlights and annotations"
description: "Draw attention to one value in a chart with highlights and annotations."
---

> Documentation Index
> Fetch the complete documentation index at: https://sandrinodm.github.io/deckster/llms.txt
> Use this file to discover all available pages before exploring further.

# Highlights and annotations

A chart on a slide has a few seconds to make its point, so it should show the audience where to look. This page shows you how to keep one series, category or point in colour, add callouts, reference lines, ranges and brackets, keep the axis honest, and build the chart one step at a time while you talk. Choosing the form comes first: see [Choosing a chart](https://sandrinodm.github.io/deckster/data-and-diagrams/choosing-a-chart/).

## Highlight what matters

`highlight` names what the chart is about; everything else drops to the brand's context colour. It takes:

- a series name (`highlight="2026"`), or else a category (`highlight="Billing and invoices"`), or `max`, `min`, `first` or `last`;
- several names as an array (`highlight={['Billing', 'Payroll']}`);
- a `Highlight` object, to say exactly what it is and from which step.

**`Highlight`**

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `series` | `string \| string[]` | — | Series to keep in color. |
| `category` | `string \| string[]` | — | Categories to keep in color (or max, min, first, last). |
| `point` | `{ series?, category } \| { series?, category }[]` | — | Single points. |
| `range` | `[string, string]` | — | A stretch of categories, `[first, last]`, both ends inclusive. On a line chart it covers the segments between consecutive highlighted points, so the line is drawn heavier and in color from the first category to the last; every segment outside it, including the one after the last category, stays muted. A range of one category colors no segment (use `category` for a single point). |
| `at` | `number` | — | The step that turns the highlight on; the chart shows its own colors before it. |

```mdx
<LineChart data={tickets} x="month" y="2026" highlight={{ range: ['Jun', 'Sep'] }} />
```

A chart that draws three or more series, or six or more categories, and highlights nothing gets `chart-no-highlight` from `deck lint`, checked on the slide's last step; `<BigNumber>`, `<Pictogram>`, `<Heatmap>` and `<Sparkline>` are exempt. `<Heatmap>` and `<Table>` take their own highlight (a cell, row or column to outline or mark), and `<Sparkline>` takes `last`, `max` or `min`; [the chart reference](https://sandrinodm.github.io/deckster/reference/charts/) has each one.

## Annotate the chart

`annotations` is a list of objects, each with a `type`:

- `callout`: a short label pointing at one category, such as the month a change shipped;
- `reference`: a line across the plot at a value, such as a target; the formatted value is added after its label;
- `range`: a shaded span of categories, such as a rollout;
- `bracket`: the change between two points of one series, written for you when you leave out `label`.

This `<AreaChart>` uses three of them:

[Live slide: "First replies have beaten the 4-hour target every week since week 29", slide 12 of the data-stories deck](https://sandrinodm.github.io/deckster/decks/data-stories/#/response-time)

`decks/data-stories/slides/response-time.mdx`:

```mdx
---
layout: chart
title: First replies have beaten the 4-hour target every week since week 29
eyebrow: Speed
surface: gradient
budget: 1m
---

<AreaChart
  data={[
    { week: 'W21', hours: 9.5 }, { week: 'W22', hours: 9.1 }, { week: 'W23', hours: 8.8 },
    { week: 'W24', hours: 9.0 }, { week: 'W25', hours: 7.2 }, { week: 'W26', hours: 5.8 },
    { week: 'W27', hours: 4.9 }, { week: 'W28', hours: 4.2 }, { week: 'W29', hours: 3.9 },
    { week: 'W30', hours: 3.6 }, { week: 'W31', hours: 3.5 }, { week: 'W32', hours: 3.1 },
    { week: 'W33', hours: 2.9 }, { week: 'W34', hours: 3.4 }, { week: 'W35', hours: 3.8 },
    { week: 'W36', hours: 3.2 }, { week: 'W37', hours: 2.8 }, { week: 'W38', hours: 2.7 },
    { week: 'W39', hours: 2.6 }, { week: 'W40', hours: 2.5 },
  ]}
  x="week"
  y="hours"
  unit="h"
  annotations={[
    { type: 'range', from: 'W25', to: 'W27', label: 'Rollout' },
    { type: 'reference', value: 4, label: 'Target' },
    { type: 'callout', x: 'W35', label: 'Back-to-school peak, still under target' },
  ]}
  caption="Median time to first reply, hours, weeks 21 to 40 of 2026"
/>

<Notes>
The shaded weeks are the rollout. From week 29 on, every week is under the line.

The bump in week 35 is the September peak, our busiest week of the year, and it still held.
</Notes>
```

`<BarChart>`, `<LineChart>`, `<AreaChart>` and `<Waterfall>` take all four; `<Slope>` and `<Scatter>` take only callouts and reference lines, and a range or a bracket throws there. The fields of each type:

**`Annotation.callout`**

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `type` (required) | `"callout"` | — | Tells annotations apart. |
| `x` (required) | `string \| number` | — | The category (a point name, on a Scatter) it points at. |
| `label` (required) | `string` | — | The text, a few words: "Redesign ships". |
| `series` | `string` | — | The series whose point it marks; the highlighted or first series (on a Slope, the `to` field). |
| `y` | `number` | — | A value to point at instead of the series' value. |
| `at` | `number` | — | The step that reveals it. |

**`Annotation.reference`**

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `type` (required) | `"reference"` | — | Tells annotations apart. |
| `value` (required) | `number` | — | The value on the value axis. |
| `label` | `string` | — | The text at its end, such as "Target"; the formatted value is added after it. |
| `at` | `number` | — | The step that reveals it. |

**`Annotation.range`**

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `type` (required) | `"range"` | — | Tells annotations apart. |
| `from` (required) | `string \| number` | — | The first category of the span. |
| `to` (required) | `string \| number` | — | The last category of the span. |
| `label` | `string` | — | The text above the span. |
| `at` | `number` | — | The step that reveals it. |

**`Annotation.bracket`**

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `type` (required) | `"bracket"` | — | Tells annotations apart. |
| `from` (required) | `string \| number` | — | The category of the first point. |
| `to` (required) | `string \| number` | — | The category of the second point. |
| `series` | `string` | — | The series; the highlighted or first series. |
| `label` | `string` | — | The text; the change between the two values when left out. |
| `relative` | `boolean` | `true` | Write the change as a percentage of the first value, or in the unit. A change across zero (or from near zero) is always in the unit. |
| `better` | `"up" \| "down"` | `up` | Which way is good news, for the label's color. |
| `at` | `number` | — | The step that reveals it. |

## Labels or a legend

Charts label the marks themselves: line ends, bar tips, slices. On `<BarChart>`, `<LineChart>` and `<AreaChart>`, `labels` chooses which values are written: `auto` (the default) labels every value when there are few enough to read, and drops the value axis, else only the highlighted ones; `all`, `highlight`, `ends` and `none` do what they say. A legend appears only where direct labels cannot name the series, as on grouped and stacked bars; `legend` forces it on or off. When a legend shows where direct labels would do, `deck lint` warns with `chart-legend-avoidable`.

## Keep the axis honest

Bars and areas start at zero. A `<BarChart>` with `min` above zero is an error unless you also set `truncate`, which draws an axis break across every bar, the value axis and an "Axis starts at" note:

```console
$ deck lint launch-review
decks/launch-review/slides/truncated.mdx
  error   chart-truncated-axis (truncated): <BarChart> sets `min` above zero; bars start at zero, so the chart draws from zero.
          Fix: In decks/launch-review/slides/truncated.mdx, remove `min`, or show the values with a <LineChart> or dots, which may zoom. Add `truncate` only if the cut is essential: the chart then draws an axis break.

launch-review: 1 error, 0 warnings in 2 slides (2 steps checked).
```

A `<LineChart>` may zoom: its axis hugs the data and says where it starts. Set `zero` to start it at zero, as both slides below do.

## Build the chart step by step

A chart builds with `at`, the step that reveals something, from step 1 (step 0 is the slide before any step). `at` goes on:

- the chart itself, to reveal the whole figure;
- a series in `y`, written as `{ field: '2026', at: 1 }`;
- the `highlight` object;
- each annotation.

This `<LineChart>` shows last year first, this year on step 1, a callout on step 2 and a bracket on step 3:

*Filmstrip: the steps of "Review rounds fell from five to two after Halden moved its decks to code", one still per step.* [Open the slide](https://sandrinodm.github.io/deckster/decks/showcase/#/review-rounds/0)

```mdx
y={['2025', { field: '2026', at: 1 }]}
highlight="2026"
annotations={[
  { type: 'callout', x: 'Apr', label: 'Decks move to code', at: 2 },
  { type: 'bracket', from: 'Apr', to: 'Sep', better: 'down', at: 3 },
]}
```

The same pattern on another slide; the bracket has no `label`, so it writes the change from June to October itself, −38%:

*Filmstrip: the steps of "Tickets fell 38% in the four months after the June redesign", one still per step.* [Open the slide](https://sandrinodm.github.io/deckster/decks/data-stories/#/redesign-effect/0)

`reveal` builds the marks for you, one series or one category per step: `reveal="series"` or `reveal="categories"` starts at step 1, and the object form starts later. `<BarChart>`, `<LineChart>`, `<AreaChart>`, `<Waterfall>` and `<Funnel>` take it; on a `<Waterfall>` the totals show from the start and the changes between them build.

**`RevealOption`**

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `by` (required) | `"series" \| "categories"` | — | What each step adds: one series, or one category, in data order. |
| `from` (required) | `number` | — | The step the first one comes in at, a whole number of 1 or more (step 0 is the slide before any step); each next one comes a step later. Series with their own `at` keep it. |

```mdx
<BarChart
  data={[
    { reason: 'Billing', share: 33 },
    { reason: 'Login', share: 17 },
    { reason: 'Integrations', share: 13 },
    { reason: 'Export', share: 9 },
  ]}
  x="reason"
  y="share"
  unit="%"
  reveal={{ by: 'categories', from: 1 }}
  highlight={{ category: 'Billing', at: 5 }}
  annotations={[{ type: 'reference', value: 30, label: 'Two next together', at: 5 }]}
  caption="Share of tickets by first-contact reason, 2026"
/>
```

Here the four bars arrive on steps 1 to 4, and on step 5 Billing keeps its colour while the others go grey, under a reference line at 30%. The last step is the complete chart, which static mode, `deck shot` and every export show. Write a `[click]` cue in the speaker notes for each step, so the talk and the build stay in order; [Builds](https://sandrinodm.github.io/deckster/write-slides/builds/) covers steps across a slide.

## What lint checks

`deck lint` renders every step and reports these chart rules ([lint rules](https://sandrinodm.github.io/deckster/reference/lint-rules/#charts) has them all):

| Rule | Severity | Reports |
| --- | --- | --- |
| `chart-empty` | error | A chart draws no marks, or a line or area chart has a single point. |
| `chart-truncated-axis` | error | A bar chart sets `min` above zero without `truncate`. |
| `chart-no-highlight` | warning | A chart with several series or many categories highlights nothing. |
| `chart-too-many-series` | warning | More series in their own colour than the brand's categorical palette has colours. |
| `chart-too-many-categories` | warning | More bars, stages, rows or items than read at a glance, from each chart's `limits`. |
| `chart-missing-unit` | warning | Values with no unit and no caption naming the measure. |
| `chart-legend-avoidable` | warning | A legend where direct labels would name the series. |
| `chart-funnel-grows` | warning | A `<Funnel>` stage holds more than the stage before it. |

Source: https://sandrinodm.github.io/deckster/data-and-diagrams/highlights-and-annotations/index.mdx
