Skip to content

Documentation / @finchart/core / index / HistogramSeries

Class: HistogramSeries ​

Defined in: packages/core/src/series/histogram-series.ts:94

A data representation that can be swapped out on the same stage (Plot).

The grid, axes, pan/zoom, and layers belong to Plot, so they stay put even when the series changes. A series answers five things — how much of the y axis it occupies, how it draws, and (optionally) how its points are thinned, how their coordinates are read, and what a tooltip says about one of them (describe, the series' alone — no registration overrides it). The two policies are resolved registration first, then the series, then the fallback: a registration's coordinates wins over the series', and plain x/y reads when neither says; a registration's decimation fields win over the series' field by field, and the wiring's policy fills what neither sets.

Implements ​

Constructors ​

Constructor ​

new HistogramSeries(options?): HistogramSeries

Defined in: packages/core/src/series/histogram-series.ts:100

Parameters ​

options? ​

HistogramSeriesOptions = {}

Returns ​

HistogramSeries

Properties ​

barBody ​

readonly barBody: true = true

Defined in: packages/core/src/series/histogram-series.ts:96

Whether each point is drawn as a body one bar slot wide — a candle, a bar, a histogram column. A fit pads the chart by half a bar at each end when any series says so, so the end bodies are drawn whole; a chart of lines alone fits edge to edge.

Implementation of ​

Series.barBody


coordinates ​

readonly coordinates: Readonly<HistogramAccessor> = HISTOGRAM_COORDINATES

Defined in: packages/core/src/series/histogram-series.ts:95

How to read coordinates from its own point. Omitted means reading x and y directly. It's here for the same reason as decimation — a candle's value is close (OHLC has no y), and only the candle knows that.

Implementation of ​

Series.coordinates

Methods ​

draw() ​

draw(target, context): void

Defined in: packages/core/src/series/histogram-series.ts:128

Parameters ​

target ​

DrawTarget

context ​

SeriesContext<HistogramPoint>

Returns ​

void

Implementation of ​

Series.draw


valueExtent() ​

valueExtent(data): Range | null

Defined in: packages/core/src/series/histogram-series.ts:110

A bar grows from the baseline — the baseline occupies value space too. This is why a volume pane starts at 0: the extent includes 0, so autoscale never pushes the floor below it.

Parameters ​

data ​

DataView<HistogramPoint>

Returns ​

Range | null

Implementation of ​

Series.valueExtent