Changes the size of a label's text, and of its marker when the style is a shape.
Pick from size.tiny, size.small, size.normal, size.large, size.huge or size.auto. The label box grows or shrinks with the text, and a shape style grows with it.
size.auto lets the chart choose a size to suit its zoom level. Stepping through sizes by a count or a score is a quick way to make a label show strength.
Syntax
label.set_size(id: series label, size: series int/string) -> void
label.set_size(size: series int/string) -> voidArguments
| Name | Type | Default | Description |
|---|---|---|---|
| id | series label | required | The label whose text size changes. Its position and colors stay the same. |
| size | series int/ | required | size.tiny, size.small, size.normal, size.large, size.huge or size.auto. Larger sizes grow the box and any shape marker. |
Returns
Nothing.
Remarks
- On Sidechair: tiny to huge draw text at 9, 10, 12, 15 and 19 px and shape markers at 6, 9, 13, 20 and 28 px.
size.autodraws text at 11 px, and a plain number is read assize.normal.
Example
//@version=6
indicator("label.set_size: up-run", overlay = true)
var label l = label.new(bar_index, high, "run")
var int run = 0
run := close > close[1] ? run + 1 : 0
label.set_xy(l, bar_index, high)
label.set_text(l, str.tostring(run))
label.set_size(l, run >= 4 ? size.huge : run >= 2 ? size.large : size.small)See also
Runs on Sidechair