Skip to content

charton API


charton API / @chart-on/core / index / Replay

Interface: Replay ​

Defined in: packages/core/src/replay.ts:64

Bar replay of the main series: from a chosen bar, later bars are hidden and revealed one at a time, by step or on a timer, so indicators, followers, the legend and the scales only ever see bars up to the replay time. Bars the data source delivers meanwhile (live bars, history pages, corrections) are kept, hidden, and shown when the replay reaches them or stops.

While playing with smooth on, each bar grows from its open through a made-up path inside its range to its close, like a live bar, and the view glides onto it. The bar always ends on its real values.

Properties ​

smooth ​

smooth: boolean = true

Defined in: packages/core/src/replay.ts:79

Grow bars and glide the view while playing (default true). Off, or with low power, a static chart or reduced motion asked for, bars appear whole.

Accessors ​

active ​

Get Signature ​

get active(): boolean

Defined in: packages/core/src/replay.ts:98

Returns ​

boolean


speed ​

Get Signature ​

get speed(): number

Defined in: packages/core/src/replay.ts:177

Bars revealed per second while playing, more than 0 and at most 100.

Returns ​

number

Set Signature ​

set speed(value): void

Defined in: packages/core/src/replay.ts:181

Parameters ​
value ​

number

Returns ​

void


state ​

Get Signature ​

get state(): ReplayState

Defined in: packages/core/src/replay.ts:87

Returns ​

ReplayState

Methods ​

absorb() ​

absorb(bar): void

Defined in: packages/core/src/replay.ts:230

A live bar while replaying: kept hidden at the end (replacing the last bar of the same time).

Parameters ​

bar ​

Bar

Returns ​

void


cancel() ​

cancel(): void

Defined in: packages/core/src/replay.ts:203

End the replay without touching the series (a new symbol replaced its bars).

Returns ​

void


pause() ​

pause(report?): void

Defined in: packages/core/src/replay.ts:168

Stop playing; a bar still growing shows its real values.

Parameters ​

report? ​

boolean = true

Returns ​

void


play() ​

play(speed?): void

Defined in: packages/core/src/replay.ts:159

Reveal bars on a timer at speed bars per second (default: the current speed) until the end or pause.

Parameters ​

speed? ​

number

Returns ​

void


replaceAll() ​

replaceAll(bars): void

Defined in: packages/core/src/replay.ts:218

New full bars for the main series (a history page or a refetch) while replaying: they replace the kept bars, and the bars up to the replay time are shown.

Parameters ​

bars ​

readonly Bar[]

Returns ​

void


start() ​

start(time): boolean

Defined in: packages/core/src/replay.ts:107

Show bars up to time (the newest at or before it) and hide the rest. False when there is no main series or no bar at or before time. While a replay runs, this moves it to time, forward or back.

Parameters ​

time ​

number

Returns ​

boolean


startRandom() ​

startRandom(__namedParameters?): boolean

Defined in: packages/core/src/replay.ts:128

Start at a random loaded bar with at least minBefore bars before it and minAfter after it, never the bar a running replay stands on when another fits. False, changing nothing, when the bars are too few for both margins.

Parameters ​

__namedParameters? ​

ReplayRandomOptions = {}

Returns ​

boolean


step() ​

step(count?): boolean

Defined in: packages/core/src/replay.ts:144

Reveal the next count bars (default 1); false when none was hidden.

Parameters ​

count? ​

number = 1

Returns ​

boolean


stop() ​

stop(): void

Defined in: packages/core/src/replay.ts:190

End the replay and show every bar, including those delivered meanwhile.

Returns ​

void