Skip to content
AlertaChartAlertaScript / docs
AlertaScript / alerta.str.length_in_pixels
On this pageSignatureParametersReturnsExample

Utilities / Reference

alerta.str.length_in_pixels

TradingView-compatible spelling: str.length_in_pixels, runs without warnings

The approximate width of a text in pixels, for laying out labels and tables: 7 pixels per character of the default font. The size argument is accepted; the estimate does not depend on it.

alerta.str.length_in_pixels(string, size) → int

Parameters

NameTypeRequiredDefaultDescription
stringstringYes—Text to measure.
sizeintNo—Font size; accepted for compatibility.

Returns

int

Example

alerta.str.length_in_pixels
//@version=6indicator("Text width")plot(str.length_in_pixels("Hello", 12), "Width (px)")

Names and aliases

Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.

AlertaScript

No results found.

Search by name, alias, or keyword.