Sidechair

table.cell_set_tooltip()

Browse the reference

Attaches hover text to one cell, so a short value can carry a longer explanation.

Try it in the editor

Keep the cell itself short and put the detail in the tooltip: the formula, the window length or the time the value was taken.

An empty string removes the tooltip. The text appears only while the pointer rests on that cell.

Syntax

Pine Script
table.cell_set_tooltip(table_id: series table, column: series int, row: series int, tooltip: series string (optional)) -> void
table.cell_set_tooltip(column: series int, row: series int, tooltip: series string (optional)) -> void

Arguments

NameTypeDefaultDescription
table_idseries tablerequiredThe table that holds the cell whose hover text changes.
columnseries intrequiredColumn of the cell that gets the tooltip, counting from 0 at the left.
rowseries intrequiredRow of the cell that gets the tooltip, counting from 0 at the top.
tooltipseries string""Hover text for the cell. An empty string removes any tooltip the cell had.

Returns

Nothing.

Example

Pine ScriptA tooltip built from the live settingsOpen in editor
//@version=6
indicator("table.cell_set_tooltip: live note", overlay = true)
len = input.int(14, "ATR length", minval = 1)
var t = table.new(position.top_right, 1, 1)
if barstate.islast
    table.cell(t, 0, 0, str.tostring(ta.atr(len), "#.##"))
    table.cell_set_tooltip(t, 0, 0, str.format("Average true range over {0} bars", len))

See also

Runs on Sidechair