Skip to content

grafit-charts


Interface: CaptionOptions ​

Extends ​

Properties ​

color? ​

optional color?: string

Inherited from ​

FontOptions.color


enabled? ​

optional enabled?: boolean

Inherited from ​

Switchable.enabled


fontFamily? ​

optional fontFamily?: string

Inherited from ​

FontOptions.fontFamily


fontSize? ​

optional fontSize?: number

Inherited from ​

FontOptions.fontSize


fontStyle? ​

optional fontStyle?: FontStyle

Inherited from ​

FontOptions.fontStyle


fontWeight? ​

optional fontWeight?: FontWeight

Inherited from ​

FontOptions.fontWeight


padding? ​

optional padding?: PaddingValue

Padding around the caption text in any CSS-like shorthand — 8, [8, 12], [8, 12, 4, 0] or { top, right, bottom, left }. By default only the plot-facing side is padded (8 px): below the caption in the 'top' zone, above it in the 'bottom' zone. When both captions share a zone, the padding of the outer one separates the two captions, and the padding of the one closest to the plot separates it from the plot. Horizontal padding narrows the width the text is wrapped within.


position? ​

optional position?: "top" | "bottom"

Vertical placement: above ('top', default) or below ('bottom') the plot.


spacing? ​

optional spacing?: number

Gap on the plot-facing side of the caption (8 by default).

Deprecated ​

Use padding — it covers the same gap and the other three sides. Kept as the default for the plot-facing side of padding.


text? ​

optional text?: string


textAlign? ​

optional textAlign?: "right" | "left" | "center"

Horizontal alignment within the chart width ('center' by default).


wrap? ​

optional wrap?: boolean

Break the text onto several lines when it does not fit the available width (true by default). Line breaks written as '\n' always apply.