Skip to content
ChartDeck ChartScript docs Account Open the terminal

textstyle

Text styles (size, font, weight, italic, colour, halo, background).

#Functions

#textstyle.newfunction

A text style (size, font, weight 300-800, italic, colour, halo outline, background).

textstyle.new({ size?: const size = size.normal, font?: const string = font.ui, weight?: const int = 400, italic?: const bool = false, color?: const color = na, halo?: const color = na, bg?: const color = na }): string
ParameterTypeDescription
sizeconst sizedefault size.normalThe text size: size.tiny ... size.huge, size.px, size.pt or size.rel.
fontconst stringdefault font.uiOne of the font.* constants.
weightconst intdefault 400Font weight, 300-800.
italicconst booldefault falsetrue: italic.
colorconst colordefault naThe colour.
haloconst colordefault naAn outline around the text, readable over candles.
bgconst colordefault naA background behind the text.

Returns string.

Example

ChartScriptFragmentOpen in editor
const ts = input.textstyle(textstyle.new(size.pt(9), font.mono, 600), "Labels")

Since ChartScript 1

The ChartScript documentation is in English for now; translations will follow.