Skip to content
ChartDeck ChartScript docs Account Open the terminal

table

Tables in a corner of the pane.

#Functions

#table.cellfunction

Sets a cell: its text and look (width / height in % of the pane, 0 = automatic).

table.cell(table_id: table, column: int, row: int, { text?: string = "", width?: float = 0, height?: float = 0, text_color?: color = color.black, text_halign?: string = text.align_center, text_valign?: string = text.align_center, text_size?: string = size.normal, bgcolor?: color = na, tooltip?: string = "", text_font_family?: string = font.family_default, text_formatting?: int = text.format_none, look?: const string = "" })
ParameterTypeDescription
table_idtableThe table id.
columnintThe column.
rowintThe row.
textstringdefault ""Text drawn with the shape.
widthfloatdefault 0The width.
heightfloatdefault 0The height.
text_colorcolordefault color.blackThe text color.
text_halignstringdefault text.align_centerThe text halign.
text_valignstringdefault text.align_centerThe text valign.
text_sizestringdefault size.normalThe text size.
bgcolorcolordefault naThe bgcolor.
tooltipstringdefault ""Help text shown next to the input.
text_font_familystringdefault font.family_defaultThe text font family.
text_formattingintdefault text.format_noneThe text formatting.
lookconst stringdefault ""A style made with style.cell (its look, shared and user-editable). Without one the drawing still follows the Labels & text tab (size, font, dimming).

Example

ChartScriptFragmentOpen in editor
state tb = table.new(position.top_right, 2, 2)
tb.cell(0, 0, "Close")

Since ChartScript 1

#table.cell_set_bgcolorfunction

Sets a cell's background.

table.cell_set_bgcolor(table_id: table, column: int, row: int, color: color)
ParameterTypeDescription
table_idtableThe table id.
columnintThe column.
rowintThe row.
colorcolorThe colour.

Example

ChartScriptFragmentOpen in editor
state tb = table.new(position.top_right, 2, 2)
tb.cell_set_bgcolor(0, 0, color.blue)

Since ChartScript 1

#table.cell_set_heightfunction

Sets a cell's height (% of the pane).

table.cell_set_height(table_id: table, column: int, row: int, height: float)
ParameterTypeDescription
table_idtableThe table id.
columnintThe column.
rowintThe row.
heightfloatThe height.

Example

ChartScriptFragmentOpen in editor
state tb = table.new(position.top_right, 2, 2)
tb.cell_set_height(0, 0, 5)

Since ChartScript 1

#table.cell_set_textfunction

Sets a cell's text.

table.cell_set_text(table_id: table, column: int, row: int, text: string)
ParameterTypeDescription
table_idtableThe table id.
columnintThe column.
rowintThe row.
textstringText drawn with the shape.

Example

ChartScriptFragmentOpen in editor
state tb = table.new(position.top_right, 2, 2)
tb.cell_set_text(0, 0, "x")

Since ChartScript 1

#table.cell_set_text_colorfunction

Sets a cell's text colour.

table.cell_set_text_color(table_id: table, column: int, row: int, text_color: color)
ParameterTypeDescription
table_idtableThe table id.
columnintThe column.
rowintThe row.
text_colorcolorThe text color.

Example

ChartScriptFragmentOpen in editor
state tb = table.new(position.top_right, 2, 2)
tb.cell_set_text_color(0, 0, color.white)

Since ChartScript 1

#table.cell_set_text_font_familyfunction

Sets a cell's font.

table.cell_set_text_font_family(table_id: table, column: int, row: int, text_font_family: string)
ParameterTypeDescription
table_idtableThe table id.
columnintThe column.
rowintThe row.
text_font_familystringThe text font family.

Example

ChartScriptFragmentOpen in editor
state tb = table.new(position.top_right, 2, 2)
tb.cell_set_text_font_family(0, 0, font.family_monospace)

Since ChartScript 1

#table.cell_set_text_formattingfunction

Bold / italic in a cell.

table.cell_set_text_formatting(table_id: table, column: int, row: int, text_formatting: int)
ParameterTypeDescription
table_idtableThe table id.
columnintThe column.
rowintThe row.
text_formattingintThe text formatting.

Example

ChartScriptFragmentOpen in editor
state tb = table.new(position.top_right, 2, 2)
tb.cell_set_text_formatting(0, 0, text.format_bold)

Since ChartScript 1

#table.cell_set_text_halignfunction

Sets a cell's horizontal alignment.

table.cell_set_text_halign(table_id: table, column: int, row: int, text_halign: string)
ParameterTypeDescription
table_idtableThe table id.
columnintThe column.
rowintThe row.
text_halignstringThe text halign.

Example

ChartScriptFragmentOpen in editor
state tb = table.new(position.top_right, 2, 2)
tb.cell_set_text_halign(0, 0, text.align_left)

Since ChartScript 1

#table.cell_set_text_sizefunction

Sets a cell's text size.

table.cell_set_text_size(table_id: table, column: int, row: int, text_size: string)
ParameterTypeDescription
table_idtableThe table id.
columnintThe column.
rowintThe row.
text_sizestringThe text size.

Example

ChartScriptFragmentOpen in editor
state tb = table.new(position.top_right, 2, 2)
tb.cell_set_text_size(0, 0, size.small)

Since ChartScript 1

#table.cell_set_text_valignfunction

Sets a cell's vertical alignment.

table.cell_set_text_valign(table_id: table, column: int, row: int, text_valign: string)
ParameterTypeDescription
table_idtableThe table id.
columnintThe column.
rowintThe row.
text_valignstringThe text valign.

Example

ChartScriptFragmentOpen in editor
state tb = table.new(position.top_right, 2, 2)
tb.cell_set_text_valign(0, 0, text.align_top)

Since ChartScript 1

#table.cell_set_tooltipfunction

Sets a cell's hover text.

table.cell_set_tooltip(table_id: table, column: int, row: int, tooltip: string)
ParameterTypeDescription
table_idtableThe table id.
columnintThe column.
rowintThe row.
tooltipstringHelp text shown next to the input.

Example

ChartScriptFragmentOpen in editor
state tb = table.new(position.top_right, 2, 2)
tb.cell_set_tooltip(0, 0, "t")

Since ChartScript 1

#table.cell_set_widthfunction

Sets a cell's width (% of the pane).

table.cell_set_width(table_id: table, column: int, row: int, width: float)
ParameterTypeDescription
table_idtableThe table id.
columnintThe column.
rowintThe row.
widthfloatThe width.

Example

ChartScriptFragmentOpen in editor
state tb = table.new(position.top_right, 2, 2)
tb.cell_set_width(0, 0, 10)

Since ChartScript 1

#table.clearfunction

Empties a rectangle of cells (one cell when the end is na).

table.clear(table_id: table, start_column: int, start_row: int, { end_column?: int = na, end_row?: int = na })
ParameterTypeDescription
table_idtableThe table id.
start_columnintThe start column.
start_rowintThe start row.
end_columnintdefault naThe end column.
end_rowintdefault naThe end row.

Example

ChartScriptFragmentOpen in editor
state tb = table.new(position.top_right, 2, 2)
tb.clear(0, 0, 1, 1)

Since ChartScript 1

#table.deletefunction

Removes the table.

table.delete(table_id: table)
ParameterTypeDescription
table_idtableThe table id.

Example

ChartScriptFragmentOpen in editor
state tb = table.new(position.top_right, 2, 2)
tb.delete()

Since ChartScript 1

#table.merge_cellsfunction

Merges a rectangle of cells into the first one.

table.merge_cells(table_id: table, start_column: int, start_row: int, end_column: int, end_row: int)
ParameterTypeDescription
table_idtableThe table id.
start_columnintThe start column.
start_rowintThe start row.
end_columnintThe end column.
end_rowintThe end row.

Example

ChartScriptFragmentOpen in editor
state tb = table.new(position.top_right, 2, 2)
tb.merge_cells(0, 0, 1, 0)

Since ChartScript 1

#table.newfunction

A table in a corner of the pane (position.*), one per position (9). The member can dock a script's tables in the bottom panel and copy their text.

table.new(position: string, columns: int, rows: int, { bgcolor?: color = na, frame_color?: color = na, frame_width?: int = 0, border_color?: color = na, border_width?: int = 0, force_overlay?: const bool = false, look?: const string = "" }): table
ParameterTypeDescription
positionstringThe position.
columnsintThe columns.
rowsintThe rows.
bgcolorcolordefault naThe bgcolor.
frame_colorcolordefault naThe frame color.
frame_widthintdefault 0The frame width.
border_colorcolordefault naThe border color.
border_widthintdefault 0The border width.
force_overlayconst booldefault falseAccepted and ignored in this version.
lookconst stringdefault ""A style made with style.table (its look, shared and user-editable). Without one the drawing still follows the Labels & text tab (size, font, dimming).

Returns table.

Example

ChartScriptFragmentOpen in editor
state tb = table.new(position.top_right, 2, 2)

Since ChartScript 1

#table.set_bgcolorfunction

Sets the background.

table.set_bgcolor(table_id: table, bgcolor: color)
ParameterTypeDescription
table_idtableThe table id.
bgcolorcolorThe bgcolor.

Example

ChartScriptFragmentOpen in editor
state tb = table.new(position.top_right, 2, 2)
tb.set_bgcolor(color.black)

Since ChartScript 1

#table.set_border_colorfunction

Sets the cell border colour.

table.set_border_color(table_id: table, border_color: color)
ParameterTypeDescription
table_idtableThe table id.
border_colorcolorThe border color.

Example

ChartScriptFragmentOpen in editor
state tb = table.new(position.top_right, 2, 2)
tb.set_border_color(color.gray)

Since ChartScript 1

#table.set_border_widthfunction

Sets the cell border width.

table.set_border_width(table_id: table, border_width: int)
ParameterTypeDescription
table_idtableThe table id.
border_widthintThe border width.

Example

ChartScriptFragmentOpen in editor
state tb = table.new(position.top_right, 2, 2)
tb.set_border_width(1)

Since ChartScript 1

#table.set_frame_colorfunction

Sets the frame colour.

table.set_frame_color(table_id: table, frame_color: color)
ParameterTypeDescription
table_idtableThe table id.
frame_colorcolorThe frame color.

Example

ChartScriptFragmentOpen in editor
state tb = table.new(position.top_right, 2, 2)
tb.set_frame_color(color.gray)

Since ChartScript 1

#table.set_frame_widthfunction

Sets the frame width.

table.set_frame_width(table_id: table, frame_width: int)
ParameterTypeDescription
table_idtableThe table id.
frame_widthintThe frame width.

Example

ChartScriptFragmentOpen in editor
state tb = table.new(position.top_right, 2, 2)
tb.set_frame_width(1)

Since ChartScript 1

#table.set_positionfunction

Moves the table to another corner.

table.set_position(table_id: table, position: string)
ParameterTypeDescription
table_idtableThe table id.
positionstringThe position.

Example

ChartScriptFragmentOpen in editor
state tb = table.new(position.top_right, 2, 2)
tb.set_position(position.bottom_left)

Since ChartScript 1

#Variables

#table.allvariable

Every table of the script that still exists.

table.all: array<table>

Type series array<table>.

Example

ChartScriptFragmentOpen in editor
const n = array.size(table.all)

Since ChartScript 1

The ChartScript documentation is in English for now; translations will follow.