---
id: "packages/active-charts/all-exports/sparkline"
title: "Sparkline"
description: "Sparkline: generated from the source of active-charts."
url: "/packages/active-charts/all-exports/sparkline"
locale: "en"
revision: "g0mvjxwj5c-88bdbe1c:sparkline"
---

# Sparkline

Exported by `@workspace/active-charts`. Generated from the package source; part of [the index of every export](/packages/active-charts/all-exports).

## `Sparkline`

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `number[] \| { x: number \| Date; y: number; }[]` | yes |  |
| `height` | `number` | yes |  |
| `width` | `number` | yes |  |
| `accessibility` | `Pick<AccessibilityOptions, "label">` | no | The sparkline's accessible name, as on every chart (`AccessibilityOptions.label`). With a name the sparkline is one image (`role="img"`) with that name; without one, or with a blank one, it is decorative and hidden from assistive technology (W6). A sparkline has no description, table or announcements. |
| `color` | `string` | no |  |
| `domain` | `readonly [number, number]` | no | The value domain, exact (T9): `[low, high]` maps to the bottom and the top of the sparkline, with no padding and no zero added, so sparklines that share one domain (a grid column) draw equal values at equal heights. A value beyond it is drawn to the edge and keeps its own number in the CSV; a min, max or last dot outside it is not drawn. A bar still reads from zero: a zero outside the domain is cut at the nearest edge, never moved. Two finite numbers, low below high, or it is reported and the automatic domain applies. Default: automatic (the data's extent with a tenth of its range on each side; a bar sparkline's extent always reaches zero). |
| `onExportComplete` | `((result: ChartExportResult) => void)` | no | Called with the file when an export (png/svg/csv/pdf) completes. |
| `onExportError` | `((format: ChartExportFormat, error: unknown) => void)` | no | Called when an export could not produce its file. |
| `onReady` | `(() => void)` | no | Called exactly once, after first successful mount with valid dimensions, before any entrance animation. |
| `showLastPoint` | `boolean` | no |  |
| `showMinMax` | `boolean` | no |  |
| `type` | `"area" \| "bar" \| "line"` | no |  |
