Skip to content

Documentation / @ripl/charts / cumulativeExtent

Function: cumulativeExtent() ​

cumulativeExtent<TSeries, TData>(series, data, getValue): [number, number]

Defined in: charts/src/core/data.ts:187

Computes the value extent [min, max] of the running cumulative total across series: the span a stacked area chart covers as each series accumulates on top of the previous ones. Both bounds seed at 0, so a single-sign dataset keeps a zero baseline.

Type Parameters ​

Type ParameterDescription
TSeriesThe series type.
TDataThe data-item type.

Parameters ​

ParameterTypeDescription
seriesTSeries[]The series that stack together, in stacking order.
dataTData[]The dataset iterated per item.
getValue(series, item) => numberResolves a series' numeric value at a data item.

Returns ​

[number, number]

The [min, max] extent covering the cumulative running total across every item.