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
LineSeries<T>
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
Returns
StepLineSeries<T>
Inherited from
Properties
coordinates
readonlycoordinates: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
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
context
Returns
void
Inherited from
toPath()
protectedtoPath(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
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