# ChartLegendOptions (@salmonui/charts/chart)

> The ChartLegendOptions interface of @salmonui/charts/chart.

Canonical: https://salmonui.dev/docs/reference/charts/chart/ChartLegendOptions

```ts
import type { ChartLegendOptions } from '@salmonui/charts/chart';
```

Entry index: https://salmonui.dev/docs/reference/charts/chart (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/charts/chart.md).

## Reference

Kind: interface

```ts
interface ChartLegendOptions {
    readonly position?: 'auto' | 'top' | 'bottom' | 'start' | 'end' | undefined;
    readonly title?: string | undefined;
    readonly toggle?: boolean | undefined;
    readonly highlight?: boolean | undefined;
    readonly maxLabelWidth?: number | undefined;
    readonly overflow?: 'wrap' | 'page' | undefined;
    readonly columns?: number | undefined;
    readonly reverse?: boolean | undefined;
    readonly align?: 'start' | 'center' | 'end' | undefined;
    readonly orientation?: 'horizontal' | 'vertical' | undefined;
    readonly mode?: 'series' | 'point' | 'range' | 'gradient' | undefined;
    readonly renderItem?: ((item: ChartLegendItem) => ReactNode) | undefined;
}
```

Members (12):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `position` | `readonly position?: 'auto' \| 'top' \| 'bottom' \| 'start' \| 'end' \| undefined;` | optional |  |
| `title` | `readonly title?: string \| undefined;` | optional |  |
| `toggle` | `readonly toggle?: boolean \| undefined;` | optional |  |
| `highlight` | `readonly highlight?: boolean \| undefined;` | optional |  |
| `maxLabelWidth` | `readonly maxLabelWidth?: number \| undefined;` | optional |  |
| `overflow` | `readonly overflow?: 'wrap' \| 'page' \| undefined;` | optional |  |
| `columns` | `readonly columns?: number \| undefined;` | optional |  |
| `reverse` | `readonly reverse?: boolean \| undefined;` | optional |  |
| `align` | `readonly align?: 'start' \| 'center' \| 'end' \| undefined;` | optional | Placement along the legend's edge (default `'center'`). |
| `orientation` | `readonly orientation?: 'horizontal' \| 'vertical' \| undefined;` | optional | `'vertical'` lays a top or bottom legend out in one column; side legends are always one column. |
| `mode` | `readonly mode?: 'series' \| 'point' \| 'range' \| 'gradient' \| undefined;` | optional | `'series'` (default, toggles series), `'point'` (the points of the first series, named by its `tooltipField`, else its x value), `'range'` / `'gradient'` (`colorRanges`); the last three are keys, not toggles. |
| `renderItem` | `readonly renderItem?: ((item: ChartLegendItem) => ReactNode) \| undefined;` | optional | Custom item content (HTML over the drawing; not part of the exported SVG). |
