Sidechair

box.set_border_width()

Browse the reference

Changes the thickness of a box's outline in pixels, with 0 hiding the outline.

Try it in the editor

A width of 1 is a hairline and each step adds a pixel. The fill and the text are not affected.

Thicken the outline on the bar where a zone is touched so the event stands out, then drop back to 1.

Syntax

Pine Script
box.set_border_width(id: series box, width: series int) -> void
box.set_border_width(width: series int) -> void

Arguments

NameTypeDefaultDescription
idseries boxrequiredThe box whose outline thickness changes.
widthseries intrequiredOutline thickness in pixels; the default for a new box is 1. Use 0 to hide the outline.

Returns

Nothing.

Remarks

  • On Sidechair: the outline is drawn centred on the edge, and a width of 0, a negative width or na draws no outline.

Example

Pine ScriptHeavier outline on a touchOpen in editor
//@version=6
indicator("box.set_border_width: touch", overlay = true)
var box z = box.new(bar_index, high, bar_index + 1, low, bgcolor = color.new(color.gray, 90))
box.set_right(z, bar_index)
box.set_border_width(z, high >= box.get_top(z) ? 3 : 1)

See also

Runs on Sidechair