Documentation
Documentation / @elitechart/core / appendPointFigure
function appendPointFigure(
state,
raw,
opts): {
newColumns: readonly Bar[];
state: PointFigureInternalState;
};
Defined in: series/point-figure.ts:156
Append zero or one column for one new source bar. Pure / deterministic.
The trailing in-flight column is flushed at end of input by
computePointFigure.
Parameters
state
| PointFigureInternalState
| undefined
raw
Bar
opts
PointFigureOptions & {
fixedDtFallback?: number;
}
Returns
{
newColumns: readonly Bar[];
state: PointFigureInternalState;
}
newColumns
readonly newColumns: readonly Bar[];
state
readonly state: PointFigureInternalState;
Example
let state: PointFigureInternalState | undefined;
for (const b of liveBars) {
const r = appendPointFigure(state, b, { boxSize: 1, reversalBoxes: 3 });
state = r.state;
}