View as Markdown

API reference: @salmonui/charts/chart

ChartDataLabelsinterface

import type { ChartDataLabels } from '@salmonui/charts/chart';
interface ChartDataLabels {
    readonly position?: 'outside' | 'top' | 'bottom' | 'middle' | 'auto' | undefined;
    readonly format?: ChartFormat | ((ctx: ChartPointContext) => string) | undefined;
    readonly angle?: number | undefined;
    readonly showZero?: boolean | undefined;
    readonly overlap?: 'none' | 'hide' | 'rotate90' | 'shiftY' | 'shiftX' | undefined;
    readonly dedupe?: boolean | undefined;
    readonly render?: ((ctx: ChartPointContext) => ReactNode) | undefined;
}
ChartDataLabels members (7)
NameSignatureDescription
positionoptionalreadonly position?: 'outside' | 'top' | 'bottom' | 'middle' | 'auto' | undefined;
formatoptionalreadonly format?: ChartFormat | ((ctx: ChartPointContext) => string) | undefined;
angleoptionalreadonly angle?: number | undefined;
showZerooptionalreadonly showZero?: boolean | undefined;
overlapoptionalreadonly overlap?: 'none' | 'hide' | 'rotate90' | 'shiftY' | 'shiftX' | undefined;

Smart labels: what a label that collides with an earlier one does (series order is priority).

dedupeoptionalreadonly dedupe?: boolean | undefined;

Drops a label whose text repeats the previous label of the series.

renderoptionalreadonly render?: ((ctx: ChartPointContext) => ReactNode) | undefined;

SVG content in place of the label text, placed at the label anchor.