charton API / @chart-on/core / index / ComparedSymbol
Interface: ComparedSymbol
Defined in: packages/core/src/chart.ts:845
A symbol plotted next to the main one; see chart.compare.
Properties
info
readonlyinfo:SymbolInfo|null
Defined in: packages/core/src/chart.ts:856
Symbol info once loaded (for a pair, its first symbol's), else null.
mode
readonlymode:CompareMode
Defined in: packages/core/src/chart.ts:851
Where it is drawn; change it with setMode.
pair
readonlypair:ComparePair|null
Defined in: packages/core/src/chart.ts:849
The ratio or spread it shows, or null for a plain symbol.
ready
readonlyready:Promise<void>
Defined in: packages/core/src/chart.ts:858
Settles when the first load finishes; failures are reported as compare:error.
series
readonlyseries:CandleSeries|LineSeries
Defined in: packages/core/src/chart.ts:854
The line of closes, or with style candles or bars a candle series; restyle it with applyOptions.
style
readonlystyle:CompareStyle
Defined in: packages/core/src/chart.ts:852
symbol
readonlysymbol:string
Defined in: packages/core/src/chart.ts:847
The symbol, or a pair's name ('A/B', 'A-B').
Methods
remove()
remove():
void
Defined in: packages/core/src/chart.ts:872
Remove the line (and its pane) and unsubscribe from the data source.
Returns
void
serialize()
serialize():
CompareState
Defined in: packages/core/src/chart.ts:859
Returns
setMode()
setMode(
mode):void
Defined in: packages/core/src/chart.ts:870
Move it to another mode, keeping its series, bars, legend row and this handle: percent (lines only) overlays the main pane in percent, scale gives it its own left axis there, pane its own pane. Leaving the main pane remembers its row's place, and coming back to pane mode puts the pane back where it was, at its height. Fires panes:change, never series:remove or series:add; percent mode switches the main scale as compare does, and the last percent comparison to leave gives it its mode back. Does nothing once removed.
Parameters
mode
Returns
void