Sets the fill behind the whole table, which shows wherever a cell has no fill of its own.
The table background sits behind every cell that has no bgcolor of its own. Use color.new(c, transparency) for a see-through panel that lets the candles show.
A cell fill from table.cell() or table.cell_set_bgcolor() wins over this color, and na removes the table fill so the chart shows through again.
Syntax
table.set_bgcolor(table_id: series table, bgcolor: series color (optional)) -> void
table.set_bgcolor(bgcolor: series color (optional)) -> voidArguments
| Name | Type | Default | Description |
|---|---|---|---|
| table_id | series table | required | The table whose background fill changes. |
| bgcolor | series color | na | Fill behind the whole table. na removes it; cells with their own bgcolor keep theirs. |
Returns
Nothing.
Example
//@version=6
indicator("table.set_bgcolor: tint", overlay = true)
var t = table.new(position.top_right, 1, 1)
if barstate.islast
table.cell(t, 0, 0, str.tostring(close))
table.set_bgcolor(t, close > open ? color.new(color.green, 70) : color.new(color.red, 70))See also
Runs on Sidechair