Switches a label between bubbles with a pointer, markers and bare text.
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
label.set_style(id: series label, style: series string) -> void
label.set_style(style: series string) -> voidArguments
| Name | Type | Default | Description |
|---|---|---|---|
| id | series label | required | The label whose shape changes. Its text, colors and anchor stay the same. |
| style | series string | required | A 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_outlineis drawn as plain text, the same aslabel.style_none.
Example
//@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