# ChartApi (@salmonui/charts/chart)

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

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

```ts
import type { ChartApi } 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 ChartApi {
    readonly element: HTMLElement | null;
    export(options?: ChartExportOptions): Promise<void>;
    toBlob(format?: 'png' | 'jpeg' | 'svg'): Promise<Blob>;
    toDataURL(format?: 'png' | 'jpeg' | 'svg'): Promise<string>;
    toSVGString(): string;
    print(): Promise<void>;
    focus(): void;
    resetZoom(): void;
    showTooltip(point: ChartPointRef): void;
    hideTooltip(): void;
    showCrosshair(at: ChartPointRef | {
        readonly x: unknown;
        readonly y?: number | undefined;
    }): void;
    hideCrosshair(): void;
    appendPoints(seriesId: string, points: readonly ChartDatum[], options?: {
        readonly maxPoints?: number;
    }): void;
}
```

Members (13):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `element` | `readonly element: HTMLElement \| null;` |  |  |
| `export` | `export(options?: ChartExportOptions): Promise<void>;` |  |  |
| `toBlob` | `toBlob(format?: 'png' \| 'jpeg' \| 'svg'): Promise<Blob>;` |  |  |
| `toDataURL` | `toDataURL(format?: 'png' \| 'jpeg' \| 'svg'): Promise<string>;` |  |  |
| `toSVGString` | `toSVGString(): string;` |  |  |
| `print` | `print(): Promise<void>;` |  |  |
| `focus` | `focus(): void;` |  |  |
| `resetZoom` | `resetZoom(): void;` |  |  |
| `showTooltip` | `showTooltip(point: ChartPointRef): void;` |  |  |
| `hideTooltip` | `hideTooltip(): void;` |  |  |
| `showCrosshair` | `showCrosshair(at: ChartPointRef \| {     readonly x: unknown;     readonly y?: number \| undefined; }): void;` |  | Shows the crosshair at a point, or at data values (`x` an axis value, `y` a y value). |
| `hideCrosshair` | `hideCrosshair(): void;` |  |  |
| `appendPoints` | `appendPoints(seriesId: string, points: readonly ChartDatum[], options?: {     readonly maxPoints?: number; }): void;` |  | Streams points into a series without a React render (`maxPoints` keeps a window). |
