Cohort chart reference

Cohort examples

Contents: Use cases, Chart IDs, Minimal spec, Data, Options, Annotations, Exclude a running period, Cumulative conversion from counts, Sizing, Fixtures, Not for.

Cohorts by periods-since-start: counts in, every retention rate derived, weighted averages that are never the mean of percentages. Type cohort. Aliases: retention.

Use cases

Chart IDs

Minimal spec

{
  "type": "cohort",
  "data": {
    "periodLabel": "Month",
    "cohorts": [
      { "id": "jan", "label": "Jan 2026", "active": [100, 70, 60], "size": 100 },
      { "id": "feb", "label": "Feb 2026", "active": [80, 60], "size": 80 }
    ]
  },
  "options": {
    "unit": "% of cohort base",
    "title": "January retains 60% of its customers at month two",
    "source": "Illustrative data"
  }
}

Data

PathTypeRequiredMeaning
periodLabelstringPeriod unit, e.g. 'Month' -> columns M0, M1, ...; omitted gives 'Period 0'.
cohortsarrayyesAt least two cohorts in chronological order, oldest first.
cohorts[].idstringyesUnique cohort identity; the computed average-row id is reserved.
cohorts[].labelstringDisplayed cohort name; defaults to its id.
cohorts[].activearrayyesWhole nonnegative active-member counts from period zero onward; null is a missing count. The first count must be a known positive cohort base; shorter rows leave later periods unobserved.
cohorts[].sizeintegerDeclared cohort base; VERIFIED against active[0], never used in its place.

Options

PathTypeValuesDefaultMeaning
formatstringRate format in percentage units, such as '1.0%' or '1.00' for two decimals without a sign on exhibit tables. Without a format the rates of the chart are one percent set under the default rule, and the heatmap keeps the set's decimals. The M0 anchor is neutral and the color scale stays fixed at 0–100%.
basisstring'cohort', 'previous''cohort''cohort' = active / cohort base (comparable down a column); 'previous' = active / the previous period's active.
averagesfalse | stringfalse, 'weighted'falseHeatmap only. Weighted column average = total active / total base of the observed cohorts.
methodNotebooleanDefault false. true adds the measure formula and explains the visible anchor column and blank cells. strings.cohortMeasure and strings.cohortFormula name another count-based measure, such as cumulative conversion. Required interpretation notes still print: the formula under basis 'previous', not-meaningful cells, weighted averages and rates too narrow to print.
variantstring'heatmap', 'pure', 'stepped''heatmap'Form. 'heatmap' (the default) draws the heatmap surface, which honors 'labels'. 'pure' and 'stepped' draw the exhibit. Stepped columns share the width the label and size columns leave, as pure columns do, and preserve weighted-average and missing-cell notes. The exhibit variants draw a fixed label set, so authoring 'labels' together with variant is refused (the legacy surface honors it).
formatScopestring'classic', 'column'Stepped fills use absolute bins ('classic') or normalize within each period ('column').
stepsarrayFour ascending thresholds in percentage points that split the absolute ('classic') stepped fills into five classes the key names, such as [70, 80, 85, 90] for period-to-period retention. Default [30, 40, 50, 60].
visiblePeriodsarrayOriginal zero-based period indices displayed in chronological order. A hidden period leaves no cell, head, note or record; rates and averages are still derived over all periods.
cohortSizeLabelstringHeader for the exhibit cohort-size column; defaults to Cohort size.
showPercentSignbooleanPrint a percent sign in every exhibit cell; defaults to false because the unit is stated once.
thresholdnumber | falsefalse (or another value of its type)Pure-exhibit emphasis threshold in percentage points: cohort and total rates above it print bold; period 0 stays neutral. A note prints only when a visible cell uses that emphasis. Defaults to 60; false disables emphasis and its note.
designatedPeriodinteger | falsefalse (or another value of its type)Original zero-based period index receiving the pure-exhibit column tint; defaults to 3. false draws no tint and no head emphasis, on variant 'pure' only.
totalfalse | stringfalse, 'weighted'Summary row. Exhibit: weighted retention by default, or false to hide it. Heatmap: 'weighted' equals averages 'weighted', false hides the average row, and total wins over averages. Never averages cohort percentages equally.
totalPositionstring'top', 'bottom'Exhibit variants: where the summary row stands, with its ground, rules and average bases; default 'bottom'. With total false it warns option-ignored.
columnVisibilityobjectTrue shows a column and false leaves it out: the ids are data.columnToggles ids on table and column ids elsewhere. Ids: size.
columnOverridesobjectSettings per generated column. Ids: label, size, periods. A periods width is per period column and replaces the shared width, and the room it leaves stays empty on the right of the table. label on periods warns, because each period keeps its own head. label on the label track sets the corner head, and label on size beats cohortSizeLabel.
columnOverrides.*.widthnumberTrack width in px. It beats the width the type would pick.
columnOverrides.*.alignstring'left', 'right', 'center'Alignment of the column: its cell text and, unless headAlign is set, its head. Bars keep starting at the panel origin.
columnOverrides.*.headAlignstring'left', 'right', 'center'Head alignment; defaults to align.
columnOverrides.*.labelstringHead text.
columnOrderarrayOrder of whole blocks; blocks left out follow in default order. Ids: size, periods.
columnHeadsfalsefalsefalse: no visible head row and no group heads, with their height and rule. Assistive technology still reads the head in React, and sortable warns there.
figuresfalsefalseVariant 'stepped': false stops the numbers on filled cells. Period 0 and other cells with no fill keep their text. Hover, records and accessible values stay.
excludeCurrentPeriodbooleanRemove the newest cohort and longest period before exhibit derivation.
exhibitLabelstringShort exhibit heading above the assertion title.
heightFillstring'rows', 'none''rows'Exhibit variants. 'rows' (default): rows take the spare height of a pinned canvas, up to 1.8 times, and stepped columns share the free width. 'none': natural row height, stepped columns at measured width.

Plus the shared options. This type does not accept detailFields, labelPosition, valueAxis, rounding, annotations. This type ignores animate, debug, rowLabels, categoryAxis, categoryLabels, secondaryAxis, topN, bandFraction, valueAxis.show, valueAxis.gridlines with an option-ignored warning.

Annotations

This type takes no annotations.

Exclude a running period

On exhibit tables, excludeCurrentPeriod: true removes the newest cohort and the last observation of each earlier cohort. A disclosure names the removed cohort and explains both removals. Every render target keeps this disclosure with footnotes: false.

The disclosure also appears in reading.notes. It does not add structured records for removed cells. visiblePeriods is a separate display filter.

Cumulative conversion from counts

Set strings.cohortMeasure to the measure name and strings.cohortFormula to its formula sentence. The strings change the notes, key caption and accessible description. They do not change the calculation.

Automatic exhibit formats keep the default rounding. A nonzero rate that would print as zero gets only the extra decimals needed to show a nonzero digit. Other rates keep their precision. Authored formats stay unchanged. A pure exhibit uses scientific notation for a zeroed rate only when its decimal text cannot fit.

Bare rate cells get their unit once, in a header line that already exists: the stepped key caption ("Retention in %"), or the corner cell above the cohort labels in pure tables and stepped tables without a key. The default is %. A visible classic key keeps an authored unit there. Only structured fields count as showing the unit: unitShown: true, a value format that prints it, a custom measure or subtitle measure that names it, or unit with a subtitle. A % in the title or in another subtitle field does not count. If fitting cuts the subtitle, the header still names the unit. The table size, calculations and number formatting do not change.

Keep basis: "cohort". Put the eligible cohort count in active[0] and the cumulative converted count in each later period. Boardplot divides each later count by active[0]. Set visiblePeriods to the later periods so the base column does not appear as a conversion result. Short rows leave later periods unobserved. The fixtures cumulative-conversion-pure and cumulative-conversion-stepped show both exhibit styles.

{
  "type": "cohort",
  "data": {
    "periodLabel": "Week",
    "cohorts": [
      { "id": "a", "label": "Batch A", "active": [1000, 5, 12] },
      { "id": "b", "label": "Batch B", "active": [800, 4] }
    ]
  },
  "options": {
    "title": "Cumulative conversion rises by the second week",
    "variant": "stepped",
    "formatScope": "classic",
    "basis": "cohort",
    "unit": "%",
    "visiblePeriods": [1, 2],
    "steps": [0.5, 1, 2, 3],
    "methodNote": true,
    "size": { "width": 1100 },
    "strings": {
      "cohortMeasure": "Cumulative conversion",
      "cohortFormula": "Cumulative conversion = converted so far / cohort base."
    }
  }
}

Sizing

Floor 280 × 28 px; fit content.

Below the floor a render is refused with size-below-floor and the pixels it needs. measure returns the natural and comfortable size for a given spec; see Sizing in the manual.

Fixtures

IDKindUse case
retention-pure-exhibitexamplePure Exhibit cohort table with a dedicated size column and weighted total
retention-stepped-columnexampleStepped cohort table with column-normalized fills and an incomplete-month exclusion
saas-logo-retentionexampleLogo retention triangle: month-3 retention climbs from 50% to 64% across the 2025 cohorts
program-participation-quarterlyexampleQuarterly participation triangle with weighted averages: 60% at quarter 1, on a support base that halves by quarter 3
retention-24x24-resurrectiontortureTorture: 24 weekly cohorts x 24 periods, long cohort labels, one resurrection cell and one pilot cohort down to a single member
missing-countstortureMissing counts leave rates and dependent totals unknown
retention-stepped-contentexampleMeasured cohort columns and a separated weighted average
retention-previous-periodexamplePeriod-to-period retention with absolute stepped fills and no total row
logo-retention-method-noteexampleLogo retention with the retention formula and the anchor column explained
crowded-average-basestortureHidden average bases name their periods
emphasis-disabledexamplePure cohort without threshold emphasis
fractional-step-keytortureCohort classes keep fractional open upper bounds
cumulative-conversion-pureexampleCount-derived cumulative conversion with its own wording
cumulative-conversion-steppedexampleCount-derived cumulative conversion with its own wording
no-size-columnexamplePure exhibit without the size column, whose bases stay in the weighted total
column-tracksexamplePure exhibit with authored track widths, alignment and heads
size-after-periodsexampleStepped exhibit with the size column after the periods
no-column-headsexamplePure exhibit without its head row, with the periods named in the subtitle
no-column-heads-steppedexampleStepped exhibit without heads or the range lines under them
total-topexampleStepped exhibit with the weighted average above the cohorts
no-designated-periodexamplePure exhibit with no tinted column
stepped-no-figuresexampleStepped exhibit whose fills carry the rates without printed numbers
heatmap-weighted-totalexampleHeatmap with the weighted average row set by total
heatmap-visible-periodsexampleHeatmap showing the later periods only, with no trace of the hidden ones

Not for

Precomputed retention percentages; cohort takes active-member counts and derives the rates.