> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reducto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Types: editor: Charts and sparklines

## `ChartDataEdit`

An edit Select Data Source makes; `series` without `index` is Add.

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type ChartDataEdit = { op: "range"; range: string } | { from: number; op: "move"; to: number } | { index: number; op: "remove" } | { hidden: boolean; index: number; op: "hide" } | { index?: number; name?: string; op: "series"; size?: string; values?: string; x?: string } | { labels: string; op: "labels" } | { empty: ChartEmptyCells; op: "empty" } | { on: boolean; op: "showHidden" } | { op: "switch" }
```

## `ChartDataSeries`

One row of Legend Entries (Series): its name, check box and the cells its parts read.

Import from `@reductoai/xlsx/editor`.

| Name | Type | Description |
| - | - | - |
| `formulas` | `SeriesFormulas` | |
| `hidden` | `boolean` | |
| `name` | `string` | |

## `ChartDataView`

What Select Data Source shows for a chart on a sheet.

Import from `@reductoai/xlsx/editor`.

| Name | Type | Description |
| - | - | - |
| `categories` | `string[]` | |
| `cells` | `ChartHiddenEmpty` | |
| `family` | `"category" \| "scatter" \| "bubble"` | "scatter" and "bubble" read x values, "category" reads category labels. |
| `labels?` | `string` | Horizontal (Category) Axis Labels: what the first shown series reads, and its labels. |
| `pivot` | `boolean` | A PivotChart takes its data from its pivot: only Switch Row/Column and Hidden and Empty Cells apply. |
| `range?` | `string` | "=Sheet1!$A$1:$C$4"; undefined when the series read more than one block. |
| `series` | `ChartDataSeries[]` | |
| `switchable` | `boolean` | |

## `ChartPane`

`design` is what Chart Design's menus check; null for a chart they cannot edit.

Import from `@reductoai/xlsx/editor`.

| Name | Type | Description |
| - | - | - |
| `design` | `ChartDesign \| null` | |
| `elements` | `ChartElementView[]` | |

## `ChartPaneState`

The selected chart as Excel's Format pane shows it: its elements and the one picked.

Import from `@reductoai/xlsx-editor`.

| Name | Type | Description |
| - | - | - |
| `design` | `ChartDesign \| null` | |
| `elements` | `ChartElementView[]` | |
| `target` | `ChartTarget` | |

## `ChartSheetCommand`

A chart sheet tab's Rename (`to`) or Delete.

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type ChartSheetCommand = { name: string; op: "rename"; to: string; type: "chartSheet" } | { name: string; op: "delete"; type: "chartSheet" }
```

## `ChartSheetView`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `before` | `number` | Worksheet index the tab sits before. |
| `chart` | `Drawing \| undefined` | |
| `h` | `number` | |
| `hidden` | `boolean` | |
| `name` | `string` | |
| `w` | `number` | The page in CSS pixels. |

## `ChartSourceBlock`

A block of cells a chart element reads, one-based, on sheet `sheet`.

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type ChartSourceBlock = CellBlock & { role: ChartSourceRole }
```

## `ChartSourceRole`

What a chart reads from a block: a series name, category or x labels, values or bubble sizes.

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type ChartSourceRole = "name" | "labels" | "values" | "size"
```

## `ChartTarget`

A chart on a sheet, by its drawing object's `cNvPr id`.

Import from `@reductoai/xlsx/editor`.

| Name | Type | Description |
| - | - | - |
| `chartSheet?` | `string` | |
| `id` | `number` | |
| `sheet` | `number` | |

## `MoveChartCommand`

`to` a worksheet index, or `newSheet`: the name of a new chart sheet. From a chart sheet,
`center` is where the chart lands in points; Excel centres it in the window.

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type MoveChartCommand = { center?: { left: number; top: number }; chart: ChartTarget; to: number; type: "moveChart" } | { chart: ChartTarget; newSheet: string; type: "moveChart" }
```

## `Sparkline`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `c` | `number` | |
| `formula?` | `string` | |
| `r` | `number` | |
| `values` | `(number \| null)[]` | |

## `SparklineGroup`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `colorAxis?` | `string` | |
| `colorFirst?` | `string` | |
| `colorHigh?` | `string` | |
| `colorLast?` | `string` | |
| `colorLow?` | `string` | |
| `colorMarkers?` | `string` | |
| `colorNegative?` | `string` | |
| `colorSeries?` | `string` | |
| `displayEmptyCellsAs` | `string` | |
| `displayHidden` | `boolean` | Data in hidden rows and columns plots; off, those points drop out. |
| `displayXAxis` | `boolean` | |
| `first` | `boolean` | |
| `groupMax?` | `number` | |
| `groupMin?` | `number` | |
| `high` | `boolean` | |
| `last` | `boolean` | |
| `lineWeight` | `number` | |
| `low` | `boolean` | |
| `manualMax?` | `number` | |
| `manualMin?` | `number` | |
| `markers` | `boolean` | |
| `maxAxisType` | `string` | |
| `minAxisType` | `string` | |
| `negative` | `boolean` | |
| `rightToLeft` | `boolean` | |
| `sparklines` | `Sparkline[]` | |
| `sparkType` | `string` | |

## `SparkSettingsMode`

Not exported by name. You get it from the API.

```ts theme={null}
type SparkSettingsMode = "empty" | "min" | "max"
```
