Skip to content

Documentation / @finchart/core / index / StepLineSeries

Class: StepLineSeries<T> ​

Defined in: packages/core/src/series/line-series.ts:201

A line whose value holds until the next x (horizontal first, then vertical). Connecting a discrete series (rate decisions, inventory, ratings) with a straight diagonal line would draw an in-between value that never existed.

Point markers stay at the data's own places, not at a step's corner — a corner is a place we invented, and marking it would show an observation that was never made. This is a separate subclass rather than an option for the same reason explained in LineSeries.toPath.

Extends ​

Type Parameters ​

T ​

T extends BaseDataPoint = LineDataPoint

Constructors ​

Constructor ​

new StepLineSeries<T>(options): StepLineSeries<T>

Defined in: packages/core/src/series/line-series.ts:60

Parameters ​

options ​

LineSeriesOptions<T>

Returns ​

StepLineSeries<T>

Inherited from ​

LineSeries.constructor

Properties ​

coordinates ​

readonly coordinates: CoordinateAccessor<T>

Defined in: packages/core/src/series/line-series.ts:57

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.

Inherited from ​

LineSeries.coordinates

Methods ​

draw() ​

draw(target, context): void

Defined in: packages/core/src/series/line-series.ts:104

The line breaks at a gap — a separate drawLine call for each run where values are unbroken. Drawing it as one continuous line would let the line cross a spot with no data — like an indicator's warmup span (MA(20)'s first 19 points) — making a missing value look like it's there.

Parameters ​

target ​

DrawTarget

context ​

SeriesContext<T>

Returns ​

void

Inherited from ​

LineSeries.draw


toPath() ​

protected toPath(run): Point[]

Defined in: packages/core/src/series/line-series.ts:204

Turns a connected run into a path to draw. Default is a no-op.

Step is a subclass rather than an option because of bundle budget — as an option it would become a branch in draw, and a consumer that never uses step would still ship that code. As a subclass, it drops out entirely for anyone who doesn't use it.

Parameters ​

run ​

Point[]

Returns ​

Point[]

Overrides ​

LineSeries.toPath


valueExtent() ​

valueExtent(data): Range | null

Defined in: packages/core/src/series/line-series.ts:82

A gap isn't counted — treating a missing value as 0 would drag the value axis all the way down to 0. null when everything is a gap, since there's nothing to measure.

Parameters ​

data ​

DataView<T>

Returns ​

Range | null

Inherited from ​

LineSeries.valueExtent