Skip to content

charton API


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

Class: HeatmapSeries ​

Defined in: packages/core/src/series.ts:4019

A time × price grid of values coloured along a ramp, such as order book depth over time. Create it with chart.addHeatmap.

Extends ​

Constructors ​

Constructor ​

new HeatmapSeries(host, pane, options): HeatmapSeries

Defined in: packages/core/src/series.ts:4038

Parameters ​

host ​

SeriesHost

pane ​

Pane

options ​

HeatmapSeriesOptions

Returns ​

HeatmapSeries

Overrides ​

Series.constructor

Properties ​

front ​

protected front: FrontChange = NO_FRONT_CHANGE

Defined in: packages/core/src/series.ts:324

How the latest history page changed the front of the data, for prependAligned.

Inherited from ​

Series.front


grid ​

readonly grid: HeatmapGrid

Defined in: packages/core/src/series.ts:4021


host ​

protected readonly host: SeriesHost

Defined in: packages/core/src/series.ts:331

Inherited from ​

Series.host


id ​

readonly id: string

Defined in: packages/core/src/series.ts:314

Inherited from ​

Series.id


kind ​

readonly kind: "heatmap" = 'heatmap'

Defined in: packages/core/src/series.ts:4020

Overrides ​

Series.kind


options ​

options: HeatmapSeriesOptions

Defined in: packages/core/src/series.ts:317

Inherited from ​

Series.options


overlayScale ​

overlayScale: PriceScale | null = null

Defined in: packages/core/src/series.ts:320

Own price scale when the series is an overlay; otherwise the pane scale is used.

Inherited from ​

Series.overlayScale


pane ​

pane: Pane

Defined in: packages/core/src/series.ts:333

The pane the series draws in; change it with chart.moveSeries.

Inherited from ​

Series.pane


rangeBuilder ​

protected readonly rangeBuilder: RangeBuilder

Defined in: packages/core/src/series.ts:322

Reused by priceRange so autoscale makes no RangeBuilder per frame.

Inherited from ​

Series.rangeBuilder


visible ​

visible: boolean = true

Defined in: packages/core/src/series.ts:316

Inherited from ​

Series.visible

Accessors ​

drawsOnGpu ​

Get Signature ​

get drawsOnGpu(): boolean

Defined in: packages/core/src/series.ts:4176

Internal

Drawn on the GPU canvas, which sits below every series drawn in 2D.

Returns ​

boolean

Overrides ​

Series.drawsOnGpu


hasCrosshairMarker ​

Get Signature ​

get hasCrosshairMarker(): boolean

Defined in: packages/core/src/series.ts:580

Internal

Whether drawCrosshair2D draws anything.

Returns ​

boolean

Inherited from ​

Series.hasCrosshairMarker


inAutoscale ​

Get Signature ​

get inAutoscale(): boolean

Defined in: packages/core/src/series.ts:536

False while the autoscale option leaves this series out of the fit.

Returns ​

boolean

Inherited from ​

Series.inAutoscale


locale ​

Get Signature ​

get protected locale(): Localizer

Defined in: packages/core/src/series.ts:405

The chart's number language (the localization option).

Returns ​

Localizer

Inherited from ​

Series.locale


priceFormat ​

Get Signature ​

get priceFormat(): PriceFormatModel | null

Defined in: packages/core/src/series.ts:410

The priceFormat option resolved in the chart's number language, or null when the series has none.

Returns ​

PriceFormatModel | null

Inherited from ​

Series.priceFormat


priceLineByDefault ​

Get Signature ​

get protected priceLineByDefault(): boolean

Defined in: packages/core/src/series.ts:633

Whether the price line is on when the option is unset.

Returns ​

boolean

Inherited from ​

Series.priceLineByDefault


pulse ​

Get Signature ​

get protected pulse(): PulseClock | null

Defined in: packages/core/src/series.ts:390

Internal

The last-point pulse's clock; null on a chart without the lastPointPulse() plugin.

Returns ​

PulseClock | null

Inherited from ​

Series.pulse


range ​

Get Signature ​

get range(): object

Defined in: packages/core/src/series.ts:4145

The colour range: the range option, else percentiles of the values, recomputed only when read after a change. Live column changes recompute it at most once per RANGE_THROTTLE_MS; a frame is requested when the wait ends.

Returns ​

object

max ​

max: number

min ​

min: number


scale ​

Get Signature ​

get scale(): PriceScale

Defined in: packages/core/src/series.ts:441

The price scale this series is drawn against.

Returns ​

PriceScale

Inherited from ​

Series.scale


zIndex ​

Get Signature ​

get zIndex(): number

Defined in: packages/core/src/series.ts:349

Draw order within the pane among series drawn by the same renderer: a higher value draws on top. GPU series (candles, histograms, heatmaps, lines and areas) always draw below 2D series (curved lines, custom series, anything with renderer: 'canvas'). Equal values keep the usual order (heatmaps, then overlays and volume profiles, then the rest, each in the order added). Changing it only redraws. Default 0.

Returns ​

number

Set Signature ​

set zIndex(value): void

Defined in: packages/core/src/series.ts:353

Parameters ​
value ​

number

Returns ​

void

Inherited from ​

Series.zIndex

Methods ​

appendAligned() ​

appendAligned(): void

Defined in: packages/core/src/series.ts:502

The main series gained a bar at the end of the timeline. Series with an incremental path align only their new items; others realign fully.

Returns ​

void

Inherited from ​

Series.appendAligned


applyOptions() ​

applyOptions(partial): void

Defined in: packages/core/src/series.ts:4043

Parameters ​

partial ​

Partial<HeatmapSeriesOptions>

Returns ​

void

Overrides ​

Series.applyOptions


cellAt() ​

cellAt(index, price): HeatmapCell | null

Defined in: packages/core/src/series.ts:4198

Cell under a logical index / price, or null.

Parameters ​

index ​

number

price ​

number

Returns ​

HeatmapCell | null


dispose() ​

dispose(): void

Defined in: packages/core/src/series.ts:4171

Free this series' GPU objects; it is leaving the chart.

Returns ​

void

Overrides ​

Series.dispose


draw2D() ​

draw2D(_ctx, _env): void

Defined in: packages/core/src/series.ts:571

Internal

Paint this series' canvas part for the pane.

Parameters ​

_ctx ​

CanvasRenderingContext2D

_env ​

PaneEnv

Returns ​

void

Inherited from ​

Series.draw2D


drawBelow() ​

drawBelow(_ctx, _env): void

Defined in: packages/core/src/series.ts:574

Internal

Paint behind every series and the GPU layer, clipped to the pane, e.g. background shading.

Parameters ​

_ctx ​

CanvasRenderingContext2D

_env ​

PaneEnv

Returns ​

void

Inherited from ​

Series.drawBelow


drawCrosshair2D() ​

drawCrosshair2D(_ctx, _env): void

Defined in: packages/core/src/series.ts:589

Internal

A marker at the crosshair (env.crosshair), on the crosshair layer: it redraws on every crosshair move, draw2D does not.

Parameters ​

_ctx ​

CanvasRenderingContext2D

_env ​

PaneEnv

Returns ​

void

Inherited from ​

Series.drawCrosshair2D


drawGL() ​

drawGL(r, env): void

Defined in: packages/core/src/series.ts:4180

Internal

Record this series' GPU draws for the pane.

Parameters ​

r ​

RenderBackend

env ​

PaneEnv

Returns ​

void

Overrides ​

Series.drawGL


firstValueFrom() ​

firstValueFrom(_index, _field?): number | undefined

Defined in: packages/core/src/series.ts:523

First value at or after logical index: the base of percent and indexed scales. field asks for the bar's open; series without one give their value.

Parameters ​

_index ​

number

_field? ​

"close" | "open"

Returns ​

number | undefined

Inherited from ​

Series.firstValueFrom


fitRange() ​

fitRange(from, to): [number, number] | null

Defined in: packages/core/src/series.ts:545

The range this series adds to its scale's autoscale: priceRange passed through the autoscale option. A throwing function is reported once and the series fits its values meanwhile; a non-finite result adds nothing.

Parameters ​

from ​

number

to ​

number

Returns ​

[number, number] | null

Inherited from ​

Series.fitRange


followMain() ​

followMain(_bars, _kind, _added?): void

Defined in: packages/core/src/series.ts:488

Re-derive the data from the main bars when the series has a follow option. On 'prepend', added is the number of bars that now lead bars.

Parameters ​

_bars ​

readonly Bar[]

_kind ​

FollowKind

_added? ​

number

Returns ​

void

Inherited from ​

Series.followMain


formatValue() ​

formatValue(value): string

Defined in: packages/core/src/series.ts:431

Label text for a value: priceFormat when set, else a format option you passed, else the pane scale's format (see scaleFormat) for a series on that scale, else compact.

Parameters ​

value ​

number

Returns ​

string

Inherited from ​

Series.formatValue


labelValueAt() ​

protected labelValueAt(_i): LastValue | null

Defined in: packages/core/src/series.ts:619

The label value of data item i, ignoring lastValueLabel; for the price line.

Parameters ​

_i ​

number

Returns ​

LastValue | null

Inherited from ​

Series.labelValueAt


lastIndexAtOrBefore() ​

lastIndexAtOrBefore(_index): number

Defined in: packages/core/src/series.ts:628

Internal

Data index of the newest item at or before logical index on the time axis (Infinity: the newest item), or -1.

Parameters ​

_index ​

number

Returns ​

number

Inherited from ​

Series.lastIndexAtOrBefore


lastValue() ​

lastValue(): LastValue | null

Defined in: packages/core/src/series.ts:605

The newest value's price-axis label while lastValueLabel is on.

Returns ​

LastValue | null

Inherited from ​

Series.lastValue


lastValues() ​

lastValues(): LastValue[]

Defined in: packages/core/src/series.ts:610

Price-axis labels for the newest values; series with several outputs return several.

Returns ​

LastValue[]

Inherited from ​

Series.lastValues


legend() ​

legend(): LegendEntry

Defined in: packages/core/src/series.ts:4215

Legend row at logical index; view is the chart's legend mode (candles also read showChange).

Returns ​

LegendEntry

Overrides ​

Series.legend


prependAligned() ​

prependAligned(_bars): void

Defined in: packages/core/src/series.ts:512

The main series gained bars older bars at the front of the timeline (a history page), so every timeline index grew by bars. Series with an incremental path shift their alignment and align and write only the new items; others realign fully.

Parameters ​

_bars ​

number

Returns ​

void

Inherited from ​

Series.prependAligned


priceLine() ​

priceLine(visibleTo): SeriesPriceLine | null

Defined in: packages/core/src/series.ts:638

Where this series' price line sits, given the newest visible logical index; null when it is off.

Parameters ​

visibleTo ​

number

Returns ​

SeriesPriceLine | null

Inherited from ​

Series.priceLine


priceLines() ​

priceLines(visibleTo): SeriesPriceLine[]

Defined in: packages/core/src/series.ts:647

Internal

The price lines drawn this frame: the series' own, or one per plot for an indicator.

Parameters ​

visibleTo ​

number

Returns ​

SeriesPriceLine[]

Inherited from ​

Series.priceLines


priceOfRow() ​

priceOfRow(row): number

Defined in: packages/core/src/series.ts:4207

Parameters ​

row ​

number

Returns ​

number


priceRange() ​

priceRange(_from, _to, _positiveOnly?): [number, number] | null

Defined in: packages/core/src/series.ts:531

Min/max over visible logical indices for autoscale, or null. With positiveOnly (the default on a log scale) values at or below zero are left out.

Parameters ​

_from ​

number

_to ​

number

_positiveOnly? ​

boolean

Returns ​

[number, number] | null

Inherited from ​

Series.priceRange


pulseFor() ​

protected pulseFor(option): PulseClock | null

Defined in: packages/core/src/series.ts:396

Internal

The clock to draw pulse option with; null without the plugin, which development builds say once.

Parameters ​

option ​

LastPointPulse | undefined

Returns ​

PulseClock | null

Inherited from ​

Series.pulseFor


realign() ​

realign(): void

Defined in: packages/core/src/series.ts:494

Recompute timeline indices after main data changes.

Returns ​

void

Inherited from ​

Series.realign


rebuild() ​

rebuild(): void

Defined in: packages/core/src/series.ts:4098

Rebuild GPU/CPU caches from data, options and theme.

Returns ​

void

Overrides ​

Series.rebuild


refollow() ​

protected refollow(): void

Defined in: packages/core/src/series.ts:491

The follow option changed: map the main bars again, or drop the derived points when it was removed.

Returns ​

void

Inherited from ​

Series.refollow


setData() ​

setData(data): void

Defined in: packages/core/src/series.ts:4049

Parameters ​

data ​

HeatmapData

Returns ​

void


setVisible() ​

setVisible(visible): void

Defined in: packages/core/src/series.ts:477

Parameters ​

visible ​

boolean

Returns ​

void

Inherited from ​

Series.setVisible


step() ​

step(_dt): boolean

Defined in: packages/core/src/series.ts:446

Advance per-series animations by dt ms; true while still animating.

Parameters ​

_dt ​

number

Returns ​

boolean

Inherited from ​

Series.step


stepOverlay() ​

stepOverlay(_dt): boolean

Defined in: packages/core/src/series.ts:455

Advance animations drawn only on the overlay (such as the last-point pulse) by dt ms, after the frame drew; true when the overlay needs another frame.

Parameters ​

_dt ​

number

Returns ​

boolean

Inherited from ​

Series.stepOverlay


updateColumn() ​

updateColumn(time, column): void

Defined in: packages/core/src/series.ts:4072

Replace the last column (same time) or append the next bar's column; an older column is dropped and reported.

Parameters ​

time ​

number

column ​

Float32Array

Returns ​

void


valueAt() ​

valueAt(col, row): number | undefined

Defined in: packages/core/src/series.ts:4211

Parameters ​

col ​

number

row ​

number

Returns ​

number | undefined