@pond-ts/charts API Reference
    Preparing search index...

    Function stacksFromGroups

    • Build a StackedBarSeries from a Map of grouped series — one series per stack group. This is the natural reader for pond's grouped-aggregate output: series.partitionBy('host', { groups }).aggregate(Sequence.every('5m'), { n: 'count' }).toMap() yields a Map<host, TimeSeries>, one interval-keyed series per host. The stack order (groups, bottom → top) is the map's insertion order (stable when you pass partitionBy's { groups } option).

      Aligned by bucket key, not by index. Each partition's aggregate spans only its own events' range, so the groups generally have different grids (host A might have buckets 0–8, host B buckets 3–9). This reader takes the union of every group's [begin, end) slots (ascending) and places each group's column value at the matching begin; a bucket a group is missing reads as a gap (NaN, contributing nothing to that stack). So the segments always line up on the real bucket, never on a positional accident. (Pass aggregate's { range } option if you want every group padded to one dense grid — the union is then that grid.) When two groups carry the same begin, the first group's end sets that slot's width — correct for the uniform-width buckets aggregate / pivotByGroup produce (all groups share the grid width), which is the intended input.

      Type Parameters

      • S extends SeriesSchema

      Parameters

      • groups: ReadonlyMap<string, TimeSeries<S>>
      • column: string

      Returns StackedBarSeries

      Error if groups is empty.

      RangeError / TypeError (via readNumericColumn) if column is missing or non-numeric in any member.