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) → intParameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
string | string | Yes | — | Text to measure. |
size | int | No | — | Font size; accepted for compatibility. |
Returns
intExample
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.