Sidechair

label.set_style()

Browse the reference

Switches a label between bubbles with a pointer, markers and bare text.

Try it in the editor

Pass any label.style_* constant. label.style_label_up puts the bubble below the anchor with its tip on top, label.style_label_down puts it above, and label_left and label_right set it beside the anchor.

Shape styles such as label.style_circle, label.style_flag or label.style_triangleup mark the anchor itself and print the text next to the marker. label.style_none drops the shape and leaves the words.

Syntax

Pine Script
label.set_style(id: series label, style: series string) -> void
label.set_style(style: series string) -> void

Arguments

NameTypeDefaultDescription
idseries labelrequiredThe label whose shape changes. Its text, colors and anchor stay the same.
styleseries stringrequiredA label.style_* constant such as label.style_label_up, label.style_circle or label.style_none. It sets the shape and the side the pointer is on.

Returns

Nothing.

Remarks

  • On Sidechair: only label_up and label_down draw a pointer tip. label_left and label_right draw a plain box beside the anchor, label_center a box on it, and label_upper_left to label_lower_right a plain box above it.
  • On Sidechair: label.style_text_outline is drawn as plain text, the same as label.style_none.

Example

Pine ScriptFlag on volume spikes, dot otherwiseOpen in editor
//@version=6
indicator("label.set_style: spike flag", overlay = true)
var label l = label.new(bar_index, high, "vol")
label.set_xy(l, bar_index, high)
label.set_style(l, volume > ta.sma(volume, 20) * 2 ? label.style_flag : label.style_circle)

See also

Runs on Sidechair