Skip to content

charton API


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

Interface: DataEvents ​

Defined in: packages/core/src/data/types.ts:274

Events emitted by the chart's data loading, by name: loads and failures, live bars and quotes, connection changes and resets.

Extended by ​

Properties ​

data:bar ​

data:bar: object

Defined in: packages/core/src/data/types.ts:301

A live bar was merged (replaced the last bar or appended).

appended ​

appended: boolean

bar ​

bar: Bar


data:error ​

data:error: object

Defined in: packages/core/src/data/types.ts:286

A load failed. error.code is 'unknown-symbol', 'load-failed', 'history-failed' or 'reset-failed', with the data source's own error as cause; a ChartError the source threw itself (e.g. 'invalid-interval') is kept. 'unknown-symbol' means the source's symbol threw, whatever the reason. kind says which load failed: 'initial', 'history', or 'reset' (a refetch after a source reset, a reconnect or chart.reload()).

error ​

error: ChartError

interval ​

interval: Interval

kind ​

kind: DataLoadKind

symbol ​

symbol: string


data:loaded ​

data:loaded: object

Defined in: packages/core/src/data/types.ts:277

Bars changed after a load; bars is the full series now on the chart.

bars ​

bars: readonly Bar[]

interval ​

interval: Interval

kind ​

kind: DataLoadKind

symbol ​

symbol: SymbolInfo


data:loading ​

data:loading: object

Defined in: packages/core/src/data/types.ts:275

interval ​

interval: Interval

kind ​

kind: DataLoadKind

symbol ​

symbol: string


data:quote ​

data:quote: object

Defined in: packages/core/src/data/types.ts:303

The data source sent a bid/ask quote for the current symbol.

quote ​

quote: Quote

symbol ​

symbol: string


data:reconnect ​

data:reconnect: object

Defined in: packages/core/src/data/types.ts:307

The live stream is back after gap seconds; missed bars are refetched unless the gap is too long.

gap ​

gap: number


data:reconnecting ​

data:reconnecting: object

Defined in: packages/core/src/data/types.ts:305

The source's live stream dropped and is reconnecting; since is when it went down.

since ​

since: number


data:reset ​

data:reset: object

Defined in: packages/core/src/data/types.ts:322

Bars were refetched after the source reported a reset (onReset); range is undefined for the whole series.

interval ​

interval: Interval

range ​

range: ResetRange | undefined

symbol ​

symbol: SymbolInfo


data:snapshot ​

data:snapshot: object

Defined in: packages/core/src/data/types.ts:320

A cached snapshot of the requested symbol and interval was painted while its load runs (see the cache option). data:loaded follows when the load lands; its bars replace the snapshot's unless they are the same.

bars ​

bars: readonly Bar[]

interval ​

interval: Interval

savedAt ​

savedAt: number

symbol ​

symbol: SymbolInfo


data:stale ​

data:stale: object

Defined in: packages/core/src/data/types.ts:314

Bars on screen may be out of date: an outage outlasted maxGapFillSeconds (reason: 'outage', gap its length), or a load failed while a cached snapshot was shown and the snapshot stays ('reconcile', gap its age). Both in seconds.

gap ​

gap: number

reason ​

reason: "outage" | "reconcile"


data:warning ​

data:warning: object

Defined in: packages/core/src/data/types.ts:293

A load landed with something missing. error.code is 'adjustments-failed' when adjustments failed for the bars of that load (kind): they show unadjusted, and the next load of the symbol and interval asks again. cause is the data source's error.

error ​

error: ChartError

interval ​

interval: Interval

kind ​

kind: DataLoadKind

symbol ​

symbol: string


interval:change ​

interval:change: object

Defined in: packages/core/src/data/types.ts:299

A load landed at another interval than the one shown before (previous is null on the first load), or at another one than requested. Emitted after data:loaded.

interval ​

interval: Interval

previous ​

previous: Interval | null

reason ​

reason: IntervalChangeReason

requested ​

requested: Interval


sourcemarkers:change ​

sourcemarkers:change: object

Defined in: packages/core/src/data/types.ts:342

chart.sourceMarkers changed: a batch landed, markers far from the view were let go, or they were dropped (a new load, another source, both options turned off). markers is the new, frozen list.

markers ​

markers: readonly SourceMarker[]


sourcemarkers:error ​

sourcemarkers:error: object

Defined in: packages/core/src/data/types.ts:336

markers failed: error.code is 'markers-failed', with the source's error as cause. The chart asks again after retryIn ms (1, 2, 4, 8, then 16 seconds); after five failures in a row retryIn is null and it asks again only after a reset of the shown bars, turning the marks or timeMarks option back on, or the next symbol or interval.

error ​

error: ChartError

interval ​

interval: Interval

retryIn ​

retryIn: number | null

symbol ​

symbol: string


sourcemarkers:loaded ​

sourcemarkers:loaded: object

Defined in: packages/core/src/data/types.ts:328

The data source's markers answered for from (inclusive) to to (exclusive). markers are the valid ones it sent within that range (frozen), dropped counts the invalid ones left out.

dropped ​

dropped: number

from ​

from: number

interval ​

interval: Interval

markers ​

markers: readonly SourceMarker[]

symbol ​

symbol: SymbolInfo

to ​

to: number