Skip to main content

Class: Table

Pine table: a grid pinned to a pane corner or edge. Mutate it on any bar; the chart only gets its latest state, sent on the last and realtime bars.

Constructors​

Constructor​

new Table(id, pane, position, columns, rows, bgcolor, frameColor, frameWidth, borderColor, borderWidth): Table

Parameters​

id​

string

pane​

string

position​

TablePosition

columns​

i32

rows​

i32

bgcolor​

i32

frameColor​

i32

frameWidth​

i32

borderColor​

i32

borderWidth​

i32

Returns​

Table

Methods​

cell()​

cell(col, row, text?, width?, height?, textColor?, halign?, valign?, size?, bgcolor?): void

Parameters​

col​

i32

row​

i32

text?​

string = ""

width?​

f64 = 0

height?​

f64 = 0

textColor?​

i32 = ...

halign?​

Align = Align.Center

valign?​

Align = Align.Center

size?​

CellSize = CellSize.Auto

bgcolor?​

i32 = 0

Returns​

void


cellSetBgcolor()​

cellSetBgcolor(col, row, color): void

Parameters​

col​

i32

row​

i32

color​

i32

Returns​

void


cellSetHeight()​

cellSetHeight(col, row, h): void

Parameters​

col​

i32

row​

i32

h​

f64

Returns​

void


cellSetText()​

cellSetText(col, row, text): void

Parameters​

col​

i32

row​

i32

text​

string

Returns​

void


cellSetTextColor()​

cellSetTextColor(col, row, color): void

Parameters​

col​

i32

row​

i32

color​

i32

Returns​

void


cellSetTextHalign()​

cellSetTextHalign(col, row, a): void

Parameters​

col​

i32

row​

i32

a​

Align

Returns​

void


cellSetTextSize()​

cellSetTextSize(col, row, size): void

Parameters​

col​

i32

row​

i32

size​

CellSize

Returns​

void


cellSetTextValign()​

cellSetTextValign(col, row, a): void

Parameters​

col​

i32

row​

i32

a​

Align

Returns​

void


cellSetWidth()​

cellSetWidth(col, row, w): void

Parameters​

col​

i32

row​

i32

w​

f64

Returns​

void


clear()​

clear(startCol, startRow, endCol?, endRow?): void

Pine table.clear: removes the cells (and merges starting) in the range; endCol/endRow -1 = the start column/row.

Parameters​

startCol​

i32

startRow​

i32

endCol?​

i32 = -1

endRow?​

i32 = -1

Returns​

void


delete()​

delete(): void

Returns​

void


flush()​

flush(): void

Emit if changed since the last emit.

Returns​

void


mergeCells()​

mergeCells(startCol, startRow, endCol, endRow): void

Parameters​

startCol​

i32

startRow​

i32

endCol​

i32

endRow​

i32

Returns​

void


setBgcolor()​

setBgcolor(c): void

Parameters​

c​

i32

Returns​

void


setBorderColor()​

setBorderColor(c): void

Parameters​

c​

i32

Returns​

void


setBorderWidth()​

setBorderWidth(w): void

Parameters​

w​

i32

Returns​

void


setFrameColor()​

setFrameColor(c): void

Parameters​

c​

i32

Returns​

void


setFrameWidth()​

setFrameWidth(w): void

Parameters​

w​

i32

Returns​

void


setPosition()​

setPosition(p): void

Parameters​

p​

TablePosition

Returns​

void


toJson()​

toJson(): string

Returns​

string


create()​

static create(position, columns, rows, bgcolor?, frameColor?, frameWidth?, borderColor?, borderWidth?, id?, pane?): Table

id "" = auto. A fixed id makes a re-run create replace the table instead of adding one (Pine table.new outside var).

Parameters​

position​

TablePosition

columns​

i32

rows​

i32

bgcolor?​

i32 = 0

frameColor?​

i32 = 0

frameWidth?​

i32 = 0

borderColor?​

i32 = 0

borderWidth?​

i32 = 0

id?​

string = ""

pane?​

string = ""

Returns​

Table