# @birchui/charts API reference

> Birch UI Charts: fast canvas charts with grid integration

```bash
npm install @birchui/charts
```

## @birchui/charts

### chartFromRange

Kind: function. Import from `@birchui/charts`.

```ts
function chartFromRange(values: readonly unknown[][], headers: readonly string[], options: RangeChartOptions = {}): ChartOptions<ChartDatum>
```

| Parameter | Type | Description |
| --- | --- | --- |
| `values` | `readonly unknown[][]` |  |
| `headers` | `readonly string[]` |  |
| `options?` | `RangeChartOptions` |  |

### checkPaletteContrast

Kind: function. Import from `@birchui/charts`.

```ts
function checkPaletteContrast(palette: readonly string[], backgrounds: readonly string[], minimum = 3): PaletteContrastReport[]
```

| Parameter | Type | Description |
| --- | --- | --- |
| `palette` | `readonly string[]` |  |
| `backgrounds` | `readonly string[]` |  |
| `minimum?` | `unknown` |  |

### contrastRatio

Kind: function. Import from `@birchui/charts`.

```ts
function contrastRatio(a: string, b: string): number
```

| Parameter | Type | Description |
| --- | --- | --- |
| `a` | `string` |  |
| `b` | `string` |  |

### createChart

Kind: function. Import from `@birchui/charts`.

```ts
function createChart<TDatum extends object = ChartDatum>(container: HTMLElement, options: ChartOptions<TDatum>): ChartApi<TDatum>
```

| Parameter | Type | Description |
| --- | --- | --- |
| `container` | `HTMLElement` |  |
| `options` | `ChartOptions<TDatum>` |  |

### createRecordingRenderer

Kind: function. Import from `@birchui/charts`.

```ts
function createRecordingRenderer(): RecordingRenderer
```

### escapeHtml

Kind: function. Import from `@birchui/charts`.

```ts
function escapeHtml(text: string): string
```

| Parameter | Type | Description |
| --- | --- | --- |
| `text` | `string` |  |

### parseCellNumber

Kind: function. Import from `@birchui/charts`.

```ts
function parseCellNumber(value: unknown): number
```

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `unknown` |  |

### sparklineSVG

Kind: function. Import from `@birchui/charts`.

```ts
function sparklineSVG(values: readonly (number | null | undefined)[], options: SparklineOptions = {}): string
```

| Parameter | Type | Description |
| --- | --- | --- |
| `values` | `readonly (number \| null \| undefined)[]` |  |
| `options?` | `SparklineOptions` |  |

### walkPath

Kind: function. Import from `@birchui/charts`.

```ts
function walkPath(path: PathData, visitor: PathVisitor): void
```

| Parameter | Type | Description |
| --- | --- | --- |
| `path` | `PathData` |  |
| `visitor` | `PathVisitor` |  |

### chartDefinition

Kind: const. Import from `@birchui/charts`.

```ts
const chartDefinition: WidgetDefinition<ChartOptions<ChartDatum>, ChartEvents<ChartDatum>, ChartApi<ChartDatum>>
```

### chartStyles

Kind: const. Import from `@birchui/charts`.

```ts
const chartStyles: "\n.lq-chart {\n --lq-font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;\n --lq-font-size: 13px;\n --lq-fg: #1f2328;\n --lq-bg: #ffffff;\n --lq-muted-fg: #656d76;\n --lq-border: #d8dee4;\n --lq-accent: #2563eb;\n --lq-accent-fg: #ffffff;\n --lq-focus-ring: #2563eb;\n --lq-radius: 6px;\n --lq-chart-grid: #eaeef2;\n --lq-chart-color-1: #2b7de9;\n --lq-chart-color-2: #d9650b;\n --lq-chart-color-3: #0f9488;\n --lq-chart-color-4: #a87b00;\n --lq-chart-color-5: #c2459b;\n --lq-chart-color-6: #3d8b37;\n --lq-chart-color-7: #8257e5;\n --lq-chart-color-8: #e0464b;\n --lq-chart-heat-1: #e8f1fd;\n --lq-chart-heat-2: #84b9f3;\n --lq-chart-heat-3: #2370cd;\n --lq-chart-heat-4: #0e3d7e;\n --lq-chart-tooltip-shadow: 0 6px 20px rgba(15, 23, 42, 0.14);\n position: relative;\n box-sizing: border-box;\n width: 100%;\n min-width: 0;\n color: var(--lq-fg);\n background: var(--lq-bg);\n font-family: var(--lq-font-family);\n font-size: var(--lq-font-size);\n line-height: 1.4;\n}\n.lq-chart-theme-dark {\n --lq-fg: #e6e8eb;\n --lq-bg: #111318;\n --lq-muted-fg: #9aa1ab;\n --lq-border: #30363d;\n --lq-accent: #6ea8fe;\n --lq-accent-fg: #0b1220;\n --lq-focus-ring: #6ea8fe;\n --lq-chart-grid: #22272e;\n --lq-chart-heat-1: #16263d;\n --lq-chart-heat-2: #1b64be;\n --lq-chart-heat-3: #519ced;\n --lq-chart-heat-4: #cce3fd;\n --lq-chart-tooltip-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);\n color-scheme: dark;\n}\n@media (prefers-color-scheme: dark) {\n .lq-chart-theme-auto {\n --lq-fg: #e6e8eb;\n --lq-bg: #111318;\n --lq-muted-fg: #9aa1ab;\n --lq-border: #30363d;\n --lq-accent: #6ea8fe;\n --lq-accent-fg: #0b1220;\n --lq-focus-ring: #6ea8fe;\n --lq-chart-grid: #22272e;\n --lq-chart-heat-1: #16263d;\n --lq-chart-heat-2: #1b64be;\n --lq-chart-heat-3: #519ced;\n --lq-chart-heat-4: #cce3fd;\n --lq-chart-tooltip-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);\n color-scheme: dark;\n }\n}\n.lq-chart-fill {\n height: 100%;\n}\n.lq-chart-stage {\n position: relative;\n width: 100%;\n overflow: hidden;\n touch-action: pan-y;\n user-select: none;\n -webkit-user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n.lq-chart-zoomed {\n touch-action: none;\n}\n.lq-chart-surface {\n position: absolute;\n top: 0;\n left: 0;\n display: block;\n border-radius: 4px;\n outline: none;\n}\n.lq-chart-surface:focus-visible {\n outline: 2px solid var(--lq-focus-ring);\n outline-offset: -2px;\n}\n.lq-chart-overlay {\n position: absolute;\n top: 0;\n left: 0;\n display: block;\n pointer-events: none;\n}\n.lq-chart-svg > svg {\n display: block;\n}\n.lq-chart-legend {\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n}\n.lq-chart-legend-item {\n position: absolute;\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0;\n border-radius: 4px;\n background: transparent;\n color: transparent;\n font: inherit;\n font-size: 1px;\n overflow: hidden;\n cursor: pointer;\n}\n.lq-chart-legend-item:hover {\n background: color-mix(in srgb, var(--lq-fg) 6%, transparent);\n}\n.lq-chart-legend-item:focus-visible {\n outline: 2px solid var(--lq-focus-ring);\n outline-offset: 1px;\n}\n.lq-chart-tooltip {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 3;\n box-sizing: border-box;\n min-width: 132px;\n max-width: 300px;\n padding: 8px 10px;\n border: 1px solid var(--lq-border);\n border-radius: var(--lq-radius);\n background: var(--lq-bg);\n color: var(--lq-fg);\n box-shadow: var(--lq-chart-tooltip-shadow);\n font-size: 12px;\n line-height: 1.45;\n pointer-events: none;\n white-space: nowrap;\n}\n.lq-chart-tooltip[hidden] {\n display: none;\n}\n.lq-chart-tooltip-title {\n margin-bottom: 4px;\n font-weight: 600;\n}\n.lq-chart-tooltip-row {\n display: flex;\n align-items: center;\n gap: 6px;\n}\n.lq-chart-tooltip-swatch {\n flex: none;\n width: 10px;\n height: 10px;\n border-radius: 2px;\n}\n.lq-chart-tooltip-label {\n flex: 1;\n overflow: hidden;\n color: var(--lq-muted-fg);\n text-overflow: ellipsis;\n}\n.lq-chart-tooltip-value {\n margin-inline-start: 12px;\n font-variant-numeric: tabular-nums;\n font-weight: 600;\n}\n.lq-chart-reset {\n position: absolute;\n top: 8px;\n inset-inline-end: 8px;\n z-index: 2;\n padding: 4px 10px;\n border: 1px solid var(--lq-border);\n border-radius: var(--lq-radius);\n background: var(--lq-bg);\n color: var(--lq-fg);\n font: inherit;\n font-size: 12px;\n cursor: pointer;\n}\n.lq-chart-reset:hover {\n border-color: var(--lq-accent);\n}\n.lq-chart-reset:focus-visible {\n outline: 2px solid var(--lq-focus-ring);\n outline-offset: 1px;\n}\n.lq-chart-reset[hidden] {\n display: none;\n}\n.lq-chart-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n border: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n white-space: nowrap;\n}\n.lq-chart-table-wrap {\n max-height: 280px;\n margin-top: 8px;\n overflow: auto;\n border: 1px solid var(--lq-border);\n border-radius: var(--lq-radius);\n}\n.lq-chart-table-wrap.lq-chart-sr-only {\n overflow: hidden;\n border: 0;\n}\n.lq-chart-table-wrap:focus-visible {\n outline: 2px solid var(--lq-focus-ring);\n outline-offset: 2px;\n}\n.lq-chart-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 12px;\n font-variant-numeric: tabular-nums;\n}\n.lq-chart-table caption {\n padding: 6px 10px;\n color: var(--lq-muted-fg);\n text-align: start;\n}\n.lq-chart-table th,\n.lq-chart-table td {\n padding: 4px 10px;\n border-top: 1px solid var(--lq-border);\n text-align: end;\n}\n.lq-chart-table th:first-child,\n.lq-chart-table td:first-child {\n text-align: start;\n}\n.lq-chart-table thead th {\n position: sticky;\n top: 0;\n background: var(--lq-bg);\n font-weight: 600;\n}\n@media (forced-colors: active) {\n .lq-chart-legend-item:focus-visible,\n .lq-chart-surface:focus-visible,\n .lq-chart :focus-visible {\n outline: 2px solid Highlight;\n }\n .lq-chart-tooltip {\n border-color: CanvasText;\n }\n}\n" = ` .lq-chart { --lq-font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --lq-font-size: 13px; --lq-fg: #1f2328; --lq-bg: #ffffff; --lq-muted-fg: #656d76; --lq-border: #d8dee4; --lq-accent: #2563eb; --lq-accent-fg: #ffffff; --lq-focus-ring: #2563eb; --lq-radius: 6px; --lq-chart-grid: #eaeef2; --lq-chart-color-1: #2b7de9; --lq-chart-color-2: #d9650b; --lq-chart-color-3: #0f9488; --lq-chart-color-4: #a87b00; --lq-chart-color-5: #c2459b; --lq-chart-color-6: #3d8b37; --lq-chart-color-7: #8257e5; --lq-chart-color-8: #e0464b; --lq-chart-heat-1: #e8f1fd; --lq-chart-heat-2: #84b9f3; --lq-chart-heat-3: #2370cd; --lq-chart-heat-4: #0e3d7e; --lq-chart-tooltip-shadow: 0 6px 20px rgba(15, 23, 42, 0.14); position: relative; box-sizing: border-box; width: 100%; min-width: 0; color: var(--lq-fg); background: var(--lq-bg); font-family: var(--lq-font-family); font-size: var(--lq-font-size); line-height: 1.4; } .lq-chart-theme-dark { --lq-fg: #e6e8eb; --lq-bg: #111318; --lq-muted-fg: #9aa1ab; --lq-border: #30363d; --lq-accent: #6ea8fe; --lq-accent-fg: #0b1220; --lq-focus-ring: #6ea8fe; --lq-chart-grid: #22272e; --lq-chart-heat-1: #16263d; --lq-chart-heat-2: #1b64be; --lq-chart-heat-3: #519ced; --lq-chart-heat-4: #cce3fd; --lq-chart-tooltip-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); color-scheme: dark; } @media (prefers-color-scheme: dark) { .lq-chart-theme-auto { --lq-fg: #e6e8eb; --lq-bg: #111318; --lq-muted-fg: #9aa1ab; --lq-border: #30363d; --lq-accent: #6ea8fe; --lq-accent-fg: #0b1220; --lq-focus-ring: #6ea8fe; --lq-chart-grid: #22272e; --lq-chart-heat-1: #16263d; --lq-chart-heat-2: #1b64be; --lq-chart-heat-3: #519ced; --lq-chart-heat-4: #cce3fd; --lq-chart-tooltip-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); color-scheme: dark; } } .lq-chart-fill { height: 100%; } .lq-chart-stage { position: relative; width: 100%; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; } .lq-chart-zoomed { touch-action: none; } .lq-chart-surface { position: absolute; top: 0; left: 0; display: block; border-radius: 4px; outline: none; } .lq-chart-surface:focus-visible { outline: 2px solid var(--lq-focus-ring); outline-offset: -2px; } .lq-chart-overlay { position: absolute; top: 0; left: 0; display: block; pointer-events: none; } .lq-chart-svg > svg { display: block; } .lq-chart-legend { position: absolute; top: 0; left: 0; width: 0; height: 0; } .lq-chart-legend-item { position: absolute; box-sizing: border-box; margin: 0; padding: 0; border: 0; border-radius: 4px; background: transparent; color: transparent; font: inherit; font-size: 1px; overflow: hidden; cursor: pointer; } .lq-chart-legend-item:hover { background: color-mix(in srgb, var(--lq-fg) 6%, transparent); } .lq-chart-legend-item:focus-visible { outline: 2px solid var(--lq-focus-ring); outline-offset: 1px; } .lq-chart-tooltip { position: absolute; top: 0; left: 0; z-index: 3; box-sizing: border-box; min-width: 132px; max-width: 300px; padding: 8px 10px; border: 1px solid var(--lq-border); border-radius: var(--lq-radius); background: var(--lq-bg); color: var(--lq-fg); box-shadow: var(--lq-chart-tooltip-shadow); font-size: 12px; line-height: 1.45; pointer-events: none; white-space: nowrap; } .lq-chart-tooltip[hidden] { display: none; } .lq-chart-tooltip-title { margin-bottom: 4px; font-weight: 600; } .lq-chart-tooltip-row { display: flex; align-items: center; gap: 6px; } .lq-chart-tooltip-swatch { flex: none; width: 10px; height: 10px; border-radius: 2px; } .lq-chart-tooltip-label { flex: 1; overflow: hidden; color: var(--lq-muted-fg); text-overflow: ellipsis; } .lq-chart-tooltip-value { margin-inline-start: 12px; font-variant-numeric: tabular-nums; font-weight: 600; } .lq-chart-reset { position: absolute; top: 8px; inset-inline-end: 8px; z-index: 2; padding: 4px 10px; border: 1px solid var(--lq-border); border-radius: var(--lq-radius); background: var(--lq-bg); color: var(--lq-fg); font: inherit; font-size: 12px; cursor: pointer; } .lq-chart-reset:hover { border-color: var(--lq-accent); } .lq-chart-reset:focus-visible { outline: 2px solid var(--lq-focus-ring); outline-offset: 1px; } .lq-chart-reset[hidden] { display: none; } .lq-chart-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; } .lq-chart-table-wrap { max-height: 280px; margin-top: 8px; overflow: auto; border: 1px solid var(--lq-border); border-radius: var(--lq-radius); } .lq-chart-table-wrap.lq-chart-sr-only { overflow: hidden; border: 0; } .lq-chart-table-wrap:focus-visible { outline: 2px solid var(--lq-focus-ring); outline-offset: 2px; } .lq-chart-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; } .lq-chart-table caption { padding: 6px 10px; color: var(--lq-muted-fg); text-align: start; } .lq-chart-table th, .lq-chart-table td { padding: 4px 10px; border-top: 1px solid var(--lq-border); text-align: end; } .lq-chart-table th:first-child, .lq-chart-table td:first-child { text-align: start; } .lq-chart-table thead th { position: sticky; top: 0; background: var(--lq-bg); font-weight: 600; } @media (forced-colors: active) { .lq-chart-legend-item:focus-visible, .lq-chart-surface:focus-visible, .lq-chart :focus-visible { outline: 2px solid Highlight; } .lq-chart-tooltip { border-color: CanvasText; } } `
```

### DEFAULT_PALETTE

Kind: const. Import from `@birchui/charts`.

```ts
const DEFAULT_PALETTE: readonly string[]
```

### AccessibilityOptions

Kind: interface. Import from `@birchui/charts`.

```ts
interface AccessibilityOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `label?` | `string` |  |
| `dataTable?` | `DataTableMode` |  |
| `keyboardNavigation?` | `boolean` |  |

### AnimationOptions

Kind: interface. Import from `@birchui/charts`.

```ts
interface AnimationOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `enabled?` | `boolean` |  |
| `duration?` | `number` |  |

### AxesOptions

Kind: interface. Import from `@birchui/charts`.

```ts
interface AxesOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `x?` | `AxisOptions` |  |
| `y?` | `AxisOptions \| AxisOptions[]` |  |

### AxisOptions

Kind: interface. Import from `@birchui/charts`.

```ts
interface AxisOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `id?` | `string` |  |
| `type?` | `AxisType` |  |
| `position?` | `AxisPosition` |  |
| `title?` | `string` |  |
| `min?` | `number \| Date` |  |
| `max?` | `number \| Date` |  |
| `nice?` | `boolean` |  |
| `gridLines?` | `boolean` |  |
| `tickCount?` | `number` |  |
| `labelRotation?` | `number \| 'auto'` |  |
| `labelFormatter?` | `(value: AxisValue) => string` |  |
| `utc?` | `boolean` |  |
| `visible?` | `boolean` |  |
| `logBase?` | `number` |  |

### ChartApi

Kind: interface. Import from `@birchui/charts`.

```ts
interface ChartApi<TDatum extends object = ChartDatum> extends Widget< ChartOptions<TDatum>, ChartEvents<TDatum> >
```

| Property | Type | Description |
| --- | --- | --- |
| `getOptions` | `() => ChartOptions<TDatum>` |  |
| `setData` | `(data: readonly TDatum[]) => void` |  |
| `setSeries` | `(series: SeriesOptions<TDatum>[]) => void` |  |
| `setSeriesVisible` | `(seriesId: string, visible: boolean) => void` |  |
| `isSeriesVisible` | `(seriesId: string) => boolean` |  |
| `setZoom` | `(range: [number, number] \| null) => void` |  |
| `getZoom` | `() => [number, number] \| null` |  |
| `resetZoom` | `() => void` |  |
| `setDataTableVisible` | `(visible: boolean) => void` |  |
| `toSVG` | `(options?: ExportOptions) => string` |  |
| `toPNG` | `(options?: ExportOptions) => Promise<Blob>` |  |
| `download` | `(format: ExportFormat, fileName?: string) => Promise<void>` |  |
| `readonly element` | `HTMLElement` | Inherited from Widget. |
| `update` | `(options: Partial<ChartOptions<TDatum>>) => void` | Inherited from Widget. |
| `on` | `<K extends keyof TEvents & string>(event: K, listener: Listener<TEvents[K]>) => () => void` | Inherited from Widget. |
| `destroy` | `() => void` | Inherited from Widget. |

### ChartEvents

Kind: interface. Import from `@birchui/charts`.

```ts
interface ChartEvents<TDatum extends object = ChartDatum>
```

| Property | Type | Description |
| --- | --- | --- |
| `ready` | `{ chart: ChartApi<TDatum> }` |  |
| `pointClick` | `{ point: ChartPoint<TDatum>; event: MouseEvent \| KeyboardEvent }` |  |
| `legendToggle` | `{ seriesId: string; name: string; visible: boolean; sliceIndex?: number }` |  |
| `zoomChange` | `{ range: [number, number] \| null; source: ZoomSource }` |  |
| `seriesHover` | `{ seriesId: string \| null; point: ChartPoint<TDatum> \| null }` |  |

### ChartOptions

Kind: interface. Import from `@birchui/charts`.

```ts
interface ChartOptions<TDatum extends object = ChartDatum>
```

| Property | Type | Description |
| --- | --- | --- |
| `series` | `SeriesOptions<TDatum>[]` |  |
| `data?` | `readonly TDatum[]` |  |
| `title?` | `string` |  |
| `subtitle?` | `string` |  |
| `axes?` | `AxesOptions` |  |
| `legend?` | `boolean \| LegendOptions` |  |
| `tooltip?` | `boolean \| TooltipOptions<TDatum>` |  |
| `zoom?` | `boolean \| ZoomOptions` |  |
| `padding?` | `Padding` |  |
| `animation?` | `boolean \| AnimationOptions` |  |
| `theme?` | `ThemeName` |  |
| `palette?` | `readonly string[]` |  |
| `locale?` | `string` |  |
| `localeText?` | `LocaleTextInput` |  |
| `rtl?` | `boolean` |  |
| `injectStyles?` | `boolean` |  |
| `licenseKey?` | `string` |  |
| `height?` | `number \| string` |  |
| `sparkline?` | `boolean` |  |
| `accessibility?` | `AccessibilityOptions` |  |
| `renderer?` | `RendererOption` |  |
| `pixelRatio?` | `number` |  |

### ChartPoint

Kind: interface. Import from `@birchui/charts`.

```ts
interface ChartPoint<TDatum extends object = ChartDatum>
```

| Property | Type | Description |
| --- | --- | --- |
| `seriesId` | `string` |  |
| `seriesName` | `string` |  |
| `seriesIndex` | `number` |  |
| `index` | `number` |  |
| `datum` | `TDatum` |  |
| `x` | `unknown` |  |
| `y` | `unknown` |  |

### Emphasis

Kind: interface. Import from `@birchui/charts`.

```ts
interface Emphasis
```

| Property | Type | Description |
| --- | --- | --- |
| `series` | `number` |  |
| `point?` | `number` |  |

### ExportOptions

Kind: interface. Import from `@birchui/charts`.

```ts
interface ExportOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `width?` | `number` |  |
| `height?` | `number` |  |
| `pixelRatio?` | `number` |  |
| `background?` | `boolean` |  |

### FontSpec

Kind: interface. Import from `@birchui/charts`.

```ts
interface FontSpec
```

| Property | Type | Description |
| --- | --- | --- |
| `size` | `number` |  |
| `family` | `string` |  |
| `weight?` | `number` |  |

### GroupItem

Kind: interface. Import from `@birchui/charts`.

```ts
interface GroupItem extends DisplayItemBase
```

| Property | Type | Description |
| --- | --- | --- |
| `kind` | `'group'` |  |
| `role?` | `string` |  |
| `clip?` | `Rect` |  |
| `items` | `DisplayItem[]` |  |
| `series?` | `number \| undefined` | Inherited from DisplayItemBase. |
| `point?` | `number \| undefined` | Inherited from DisplayItemBase. |
| `opacity?` | `number \| undefined` | Inherited from DisplayItemBase. |

### LegendOptions

Kind: interface. Import from `@birchui/charts`.

```ts
interface LegendOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `enabled?` | `boolean` |  |
| `position?` | `LegendPosition` |  |

### MarkerOptions

Kind: interface. Import from `@birchui/charts`.

```ts
interface MarkerOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `enabled?` | `boolean` |  |
| `size?` | `number` |  |
| `shape?` | `MarkerShape` |  |

### MarkersItem

Kind: interface. Import from `@birchui/charts`.

```ts
interface MarkersItem extends DisplayItemBase
```

| Property | Type | Description |
| --- | --- | --- |
| `kind` | `'markers'` |  |
| `points` | `ArrayLike<number>` |  |
| `radius` | `number` |  |
| `radii?` | `ArrayLike<number>` |  |
| `shape` | `MarkerShape` |  |
| `fill?` | `string` |  |
| `fillOpacity?` | `number` |  |
| `stroke?` | `StrokeStyle` |  |
| `series?` | `number \| undefined` | Inherited from DisplayItemBase. |
| `point?` | `number \| undefined` | Inherited from DisplayItemBase. |
| `opacity?` | `number \| undefined` | Inherited from DisplayItemBase. |

### PaletteContrastReport

Kind: interface. Import from `@birchui/charts`.

```ts
interface PaletteContrastReport
```

| Property | Type | Description |
| --- | --- | --- |
| `color` | `string` |  |
| `background` | `string` |  |
| `ratio` | `number` |  |
| `passes` | `boolean` |  |

### PathItem

Kind: interface. Import from `@birchui/charts`.

```ts
interface PathItem extends DisplayItemBase
```

| Property | Type | Description |
| --- | --- | --- |
| `kind` | `'path'` |  |
| `path` | `PathData` |  |
| `fill?` | `string` |  |
| `fillOpacity?` | `number` |  |
| `stroke?` | `StrokeStyle` |  |
| `series?` | `number \| undefined` | Inherited from DisplayItemBase. |
| `point?` | `number \| undefined` | Inherited from DisplayItemBase. |
| `opacity?` | `number \| undefined` | Inherited from DisplayItemBase. |

### PathVisitor

Kind: interface. Import from `@birchui/charts`.

```ts
interface PathVisitor
```

| Property | Type | Description |
| --- | --- | --- |
| `moveTo` | `(x: number, y: number) => void` |  |
| `lineTo` | `(x: number, y: number) => void` |  |
| `cubicTo` | `(c1x: number, c1y: number, c2x: number, c2y: number, x: number, y: number) => void` |  |
| `arc` | `(cx: number, cy: number, radius: number, startAngle: number, endAngle: number, counterClockwise: boolean) => void` |  |
| `close` | `() => void` |  |

### RangeChartOptions

Kind: interface. Import from `@birchui/charts`.

```ts
interface RangeChartOptions extends Partial<Omit<ChartOptions, 'data' | 'series'>>
```

| Property | Type | Description |
| --- | --- | --- |
| `type?` | `SeriesType` |  |
| `stacked?` | `StackMode` |  |
| `categoryColumn?` | `number` |  |
| `horizontal?` | `boolean` |  |
| `sparkline?` | `boolean \| undefined` | Inherited from ChartOptions. |
| `theme?` | `ThemeName \| undefined` | Inherited from ChartOptions. |
| `licenseKey?` | `string \| undefined` | Inherited from ChartOptions. |
| `localeText?` | `LocaleTextInput \| undefined` | Inherited from ChartOptions. |
| `rtl?` | `boolean \| undefined` | Inherited from ChartOptions. |
| `injectStyles?` | `boolean \| undefined` | Inherited from ChartOptions. |
| `locale?` | `string \| undefined` | Inherited from ChartOptions. |
| `height?` | `string \| number \| undefined` | Inherited from ChartOptions. |
| `title?` | `string \| undefined` | Inherited from ChartOptions. |
| `subtitle?` | `string \| undefined` | Inherited from ChartOptions. |
| `axes?` | `AxesOptions \| undefined` | Inherited from ChartOptions. |
| `legend?` | `boolean \| LegendOptions \| undefined` | Inherited from ChartOptions. |
| `tooltip?` | `boolean \| TooltipOptions<ChartDatum> \| undefined` | Inherited from ChartOptions. |
| `zoom?` | `boolean \| ZoomOptions \| undefined` | Inherited from ChartOptions. |
| `padding?` | `Padding \| undefined` | Inherited from ChartOptions. |
| `animation?` | `boolean \| AnimationOptions \| undefined` | Inherited from ChartOptions. |
| `palette?` | `readonly string[] \| undefined` | Inherited from ChartOptions. |
| `accessibility?` | `AccessibilityOptions \| undefined` | Inherited from ChartOptions. |
| `renderer?` | `RendererOption \| undefined` | Inherited from ChartOptions. |
| `pixelRatio?` | `number \| undefined` | Inherited from ChartOptions. |

### RecordedFrame

Kind: interface. Import from `@birchui/charts`.

```ts
interface RecordedFrame
```

| Property | Type | Description |
| --- | --- | --- |
| `layer` | `RenderLayer` |  |
| `width` | `number` |  |
| `height` | `number` |  |
| `pixelRatio` | `number` |  |
| `items` | `readonly DisplayItem[]` |  |
| `options` | `RenderPassOptions` |  |

### RecordingRenderer

Kind: interface. Import from `@birchui/charts`.

```ts
interface RecordingRenderer
```

| Property | Type | Description |
| --- | --- | --- |
| `readonly factory` | `RenderBackendFactory` |  |
| `readonly frames` | `RecordedFrame[]` |  |
| `readonly backends` | `RenderBackend[]` |  |
| `lastFrame` | `(layer?: RenderLayer) => RecordedFrame \| undefined` |  |
| `destroyed` | `() => number` |  |

### Rect

Kind: interface. Import from `@birchui/charts`.

```ts
interface Rect
```

| Property | Type | Description |
| --- | --- | --- |
| `x` | `number` |  |
| `y` | `number` |  |
| `width` | `number` |  |
| `height` | `number` |  |

### RectItem

Kind: interface. Import from `@birchui/charts`.

```ts
interface RectItem extends DisplayItemBase
```

| Property | Type | Description |
| --- | --- | --- |
| `kind` | `'rect'` |  |
| `x` | `number` |  |
| `y` | `number` |  |
| `width` | `number` |  |
| `height` | `number` |  |
| `fill?` | `string` |  |
| `fillOpacity?` | `number` |  |
| `stroke?` | `StrokeStyle` |  |
| `radius?` | `number \| readonly [number, number, number, number]` |  |
| `series?` | `number \| undefined` | Inherited from DisplayItemBase. |
| `point?` | `number \| undefined` | Inherited from DisplayItemBase. |
| `opacity?` | `number \| undefined` | Inherited from DisplayItemBase. |

### RenderBackend

Kind: interface. Import from `@birchui/charts`.

```ts
interface RenderBackend
```

| Property | Type | Description |
| --- | --- | --- |
| `readonly kind` | `string` |  |
| `readonly element` | `HTMLElement \| SVGElement` |  |
| `resize` | `(width: number, height: number, pixelRatio: number) => void` |  |
| `render` | `(items: readonly DisplayItem[], options?: RenderPassOptions) => void` |  |
| `measureText` | `(text: string, font: FontSpec) => number` |  |
| `destroy` | `() => void` |  |

### RenderPassOptions

Kind: interface. Import from `@birchui/charts`.

```ts
interface RenderPassOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `emphasis?` | `Emphasis \| null` |  |
| `background?` | `string \| null` |  |

### SeriesOptions

Kind: interface. Import from `@birchui/charts`.

```ts
interface SeriesOptions<TDatum extends object = ChartDatum>
```

| Property | Type | Description |
| --- | --- | --- |
| `type` | `SeriesType` |  |
| `xKey` | `DataKey<TDatum>` |  |
| `yKey` | `DataKey<TDatum>` |  |
| `sizeKey?` | `DataKey<TDatum>` |  |
| `colorKey?` | `DataKey<TDatum>` |  |
| `id?` | `string` |  |
| `name?` | `string` |  |
| `color?` | `string` |  |
| `data?` | `readonly TDatum[]` |  |
| `visible?` | `boolean` |  |
| `stacked?` | `StackMode` |  |
| `stackGroup?` | `string` |  |
| `yAxis?` | `string` |  |
| `horizontal?` | `boolean` |  |
| `curve?` | `CurveType` |  |
| `markers?` | `boolean \| MarkerOptions` |  |
| `lineWidth?` | `number` |  |
| `fillOpacity?` | `number` |  |
| `innerRadius?` | `number` |  |
| `labels?` | `boolean` |  |
| `decimation?` | `boolean` |  |

### SparklineOptions

Kind: interface. Import from `@birchui/charts`.

```ts
interface SparklineOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `type?` | `'line' \| 'area' \| 'bar'` |  |
| `width?` | `number` |  |
| `height?` | `number` |  |
| `color?` | `string` |  |
| `theme?` | `'light' \| 'dark'` |  |
| `lineWidth?` | `number` |  |
| `label?` | `string` |  |
| `localeText?` | `LocaleTextInput` |  |

### StrokeStyle

Kind: interface. Import from `@birchui/charts`.

```ts
interface StrokeStyle
```

| Property | Type | Description |
| --- | --- | --- |
| `color` | `string` |  |
| `width` | `number` |  |
| `dash?` | `readonly number[]` |  |
| `cap?` | `'butt' \| 'round' \| 'square'` |  |
| `join?` | `'miter' \| 'round' \| 'bevel'` |  |

### TextItem

Kind: interface. Import from `@birchui/charts`.

```ts
interface TextItem extends DisplayItemBase
```

| Property | Type | Description |
| --- | --- | --- |
| `kind` | `'text'` |  |
| `x` | `number` |  |
| `y` | `number` |  |
| `text` | `string` |  |
| `font` | `FontSpec` |  |
| `color` | `string` |  |
| `align` | `TextAlign` |  |
| `baseline` | `TextBaseline` |  |
| `rotation?` | `number` |  |
| `series?` | `number \| undefined` | Inherited from DisplayItemBase. |
| `point?` | `number \| undefined` | Inherited from DisplayItemBase. |
| `opacity?` | `number \| undefined` | Inherited from DisplayItemBase. |

### TooltipContext

Kind: interface. Import from `@birchui/charts`.

```ts
interface TooltipContext<TDatum extends object = ChartDatum>
```

| Property | Type | Description |
| --- | --- | --- |
| `title` | `string` |  |
| `points` | `TooltipPoint<TDatum>[]` |  |

### TooltipOptions

Kind: interface. Import from `@birchui/charts`.

```ts
interface TooltipOptions<TDatum extends object = ChartDatum>
```

| Property | Type | Description |
| --- | --- | --- |
| `enabled?` | `boolean` |  |
| `shared?` | `boolean` |  |
| `formatter?` | `(context: TooltipContext<TDatum>) => string \| null \| undefined` |  |

### TooltipPoint

Kind: interface. Import from `@birchui/charts`.

```ts
interface TooltipPoint<TDatum extends object = ChartDatum>
```

| Property | Type | Description |
| --- | --- | --- |
| `seriesId` | `string` |  |
| `seriesName` | `string` |  |
| `color` | `string` |  |
| `datum` | `TDatum` |  |
| `x` | `unknown` |  |
| `y` | `unknown` |  |
| `xLabel` | `string` |  |
| `yLabel` | `string` |  |
| `detail?` | `string` |  |

### ZoomOptions

Kind: interface. Import from `@birchui/charts`.

```ts
interface ZoomOptions
```

| Property | Type | Description |
| --- | --- | --- |
| `enabled?` | `boolean` |  |
| `drag?` | `boolean` |  |
| `wheel?` | `boolean` |  |
| `pan?` | `boolean` |  |

### AxisPosition

Kind: type. Import from `@birchui/charts`.

```ts
type AxisPosition = 'left' | 'right' | 'top' | 'bottom';
```

### AxisType

Kind: type. Import from `@birchui/charts`.

```ts
type AxisType = 'category' | 'linear' | 'log' | 'time';
```

### AxisValue

Kind: type. Import from `@birchui/charts`.

```ts
type AxisValue = number | string | Date;
```

### ChartDatum

Kind: type. Import from `@birchui/charts`.

```ts
type ChartDatum = Record<string, unknown>;
```

### CurveType

Kind: type. Import from `@birchui/charts`.

```ts
type CurveType = 'linear' | 'smooth' | 'step' | 'stepBefore' | 'stepAfter';
```

### DataKey

Kind: type. Import from `@birchui/charts`.

```ts
type DataKey<TDatum> = Extract<keyof TDatum, string>;
```

### DataTableMode

Kind: type. Import from `@birchui/charts`.

```ts
type DataTableMode = 'hidden' | 'visible' | 'off';
```

### DisplayItem

Kind: type. Import from `@birchui/charts`.

```ts
type DisplayItem = RectItem | PathItem | TextItem | MarkersItem | GroupItem;
```

### ExportFormat

Kind: type. Import from `@birchui/charts`.

```ts
type ExportFormat = 'png' | 'svg';
```

### LegendPosition

Kind: type. Import from `@birchui/charts`.

```ts
type LegendPosition = 'top' | 'bottom' | 'left' | 'right';
```

### MarkerShape

Kind: type. Import from `@birchui/charts`.

```ts
type MarkerShape = 'circle' | 'square' | 'diamond' | 'triangle';
```

### Padding

Kind: type. Import from `@birchui/charts`.

```ts
type Padding = number | { top?: number; right?: number; bottom?: number; left?: number };
```

### PathData

Kind: type. Import from `@birchui/charts`.

```ts
type PathData = number[];
```

### RenderBackendFactory

Kind: type. Import from `@birchui/charts`.

```ts
type RenderBackendFactory = (document: Document, layer: RenderLayer) => RenderBackend | null;
```

### RendererOption

Kind: type. Import from `@birchui/charts`.

```ts
type RendererOption = 'auto' | 'canvas' | 'svg' | RenderBackendFactory;
```

### RenderLayer

Kind: type. Import from `@birchui/charts`.

```ts
type RenderLayer = 'main' | 'overlay';
```

### SeriesType

Kind: type. Import from `@birchui/charts`.

```ts
type SeriesType = 'line' | 'area' | 'bar' | 'column' | 'scatter' | 'bubble' | 'pie' | 'donut' | 'heatmap';
```

### StackMode

Kind: type. Import from `@birchui/charts`.

```ts
type StackMode = boolean | 'normal' | 'percent';
```

### TextAlign

Kind: type. Import from `@birchui/charts`.

```ts
type TextAlign = 'left' | 'center' | 'right';
```

### TextBaseline

Kind: type. Import from `@birchui/charts`.

```ts
type TextBaseline = 'top' | 'middle' | 'bottom' | 'alphabetic';
```

### ThemeName

Kind: type. Import from `@birchui/charts`.

```ts
type ThemeName = 'light' | 'dark' | 'auto';
```

### ZoomSource

Kind: type. Import from `@birchui/charts`.

```ts
type ZoomSource = 'drag' | 'wheel' | 'pinch' | 'pan' | 'keyboard' | 'api' | 'reset';
```
