Sidechair

label.set_text_formatting()

Browse the reference

Makes a label's text bold, italic, both, or plain.

Try it in the editor

Pass text.format_bold, text.format_italic, text.format_none, or combine two with +, as in text.format_bold + text.format_italic. Pick text.format_none to clear a style set earlier.

It applies to all text in that label; the text color and size are unchanged.

Syntax

Pine Script
label.set_text_formatting(id: series label, text_formatting: series text_format) -> void
label.set_text_formatting(text_formatting: series text_format) -> void

Arguments

NameTypeDefaultDescription
idseries labelrequiredThe label whose text style changes. Colors, size and the words stay as set.
text_formattingseries text_formatrequiredtext.format_none, text.format_bold, text.format_italic, or two of them joined with +, for example text.format_bold + text.format_italic.

Returns

Nothing.

Remarks

  • On Sidechair: text formatting is not applied yet. The call warns that it isn't supported and the text stays plain.

Example

Pine ScriptBold on a breakout, plain otherwiseOpen in editor
//@version=6
indicator("label.set_text_formatting: bold on breakout", overlay = true)
var label l = label.new(bar_index, high, "Breakout")
label.set_xy(l, bar_index, high)
label.set_text_formatting(l, close > ta.highest(high, 20)[1] ? text.format_bold : text.format_none)

See also

Not on Sidechair yet