Skip to main content

GrowthChart

ComplexSpecialty<co-growth-chart>

GrowthChart plots a child’s measurements against WHO (birth to 24 months) or CDC (2 to 20 years) percentile lines and names the percentile band of every point.

import { GrowthChart } from 'health-components';

Examples​

Cdc Bmi Above95th​

Storybook

Legacy Percentiles​

Storybook

Usage​

<GrowthChart standard="cdc" measure="bmi" points={[[8, 17.2, "03/2022"], [10, 19.8, "03/2024"]]} curves={cdcBmiBoys} />

When to use​

  • Well-child visits, failure to thrive and obesity follow-up, endocrine and nutrition clinics.

When not to use​

  • Preterm infants before 2 years corrected: a Fenton chart.
  • Adult weight trends: LineChart.

Variants and states​

VariantWhat it is
WHO 0-2Weight-for-age in kg to 0.01, ages in months, 3rd to 97th lines.
CDC 2-20BMI-for-age in kg/m² to 0.1, ages in years, 5th to 95th lines.
edge linesOuter percentiles in warning colour; 50th solid.
band badgeLatest point: "Between the 50th and 85th" (success) or above or below the outer lines (warning).
tableEvery plotted point with date, age, value and band.

Clinical values​

Every number goes through the shared clinical value rules (CareOS.fmt and ClinicalValue from the clinical-values card): tabular digits, the unit always shown, a fixed precision per measure, the reference range in the tooltip, and H, L or critical flags. Medication amounts follow the ISMP dose style through fmt.doseNumber: rounded to the stated precision, then shown with no trailing zero (5 mg, never 5.0 mg) and a leading zero (0.5 mL). The specialty measures this card adds sit in CareOS.specialty.MEAS with their precision: infant weight 2 decimals kg, BMI 1 decimal kg/m². Ranges in the previews are sample values for the design system, not clinical guidance; a real deployment passes its own.

Accessibility​

  • The SVG label lists every point; each point also has a title.
  • The band is stated in words in a badge and in the table.
  • The 50th line is solid, others dashed, so they differ without colour.

Do and don't​

  • Do: Pick WHO under 2 years and CDC from 2 years.
  • Do: Plot every measurement, not only the latest.
  • Don't: State an exact percentile from the drawn lines.
  • Don't: Ship the sample curves.

Props​

PropTypeDefaultDescription
standardGrowthStandarduncontrolledStandard shown (controlled): 'who' | 'cdc'
defaultStandardGrowthStandard'who'First standard shown (uncontrolled)
measure'weight' | 'bmi' | (string & {})'weight''weight' | 'bmi' | string: picks the built-in curve
sex'male' | 'female''male''male' | 'female': picks the built-in curve
pointsReadonlyArray<GrowthPoint>[]Array<[age, value, date?]>
curvesGrowthCurvesthe built-in sample for standard, measure and sex{unit, ages, ageUnit, lines, title}
onStandardChange(standard: GrowthStandard) => voidnoneCalled with the new standard; the parent passes the matching `curves`. Without it, custom curves hide the switch
titlestringthe curves' titleCard title
subtitlestringnoneLine under the title
noteReactNodehow percentile bands are readNote under the table
rangeContextRangeContextIdthe global context, else 'outpatient'Which shared reference range flags use; the lab range on a result still wins
percentilesReadonly<Record<string, ReadonlyArray<number>>>—Legacy (use `curves`): Record<percentile, value per age in `ages`>, ages in months
agesReadonlyArray<number>[0,6,12,18,24,36]Legacy (use `curves`): ages in months of `percentiles`
minnumberfrom the dataLegacy: bottom of the y axis
maxnumberfrom the dataLegacy: top of the y axis
unitstring—Legacy (use `curves.unit`): unit label of the values ('kg')

Also accepts native attributes, including defaultChecked, defaultValue, autoFocus, plus className and event handlers on the root element.

Angular, Vue and HTML​

Register the elements once (Angular guide), then use <co-growth-chart>. Attributes take strings; arrays and objects are set as properties (Angular [prop], Vue :prop) or as JSON attributes. Callbacks are DOM events with the value in event.detail.

Angular template
<co-growth-chart standard="…" default-standard="…" [measure]="measure" (co-standard-change)="onStandardChange($event.detail)"></co-growth-chart>
KindNameDescription
attributestandardStandard shown (controlled): 'who' | 'cdc'; default uncontrolled
attributedefault-standard / defaultStandardFirst standard shown (uncontrolled); default 'who'
property / JSON attributemeasure'weight' | 'bmi' | string: picks the built-in curve; default 'weight'
attributesex'male' | 'female': picks the built-in curve; default 'male'
property / JSON attributepointsArray<[age, value, date?]>; default []
property / JSON attributecurves{unit, ages, ageUnit, lines, title}; default the built-in sample for standard, measure and sex
attributetitleCard title; default the curves' title
attributesubtitleLine under the title; default none
attributerange-context / rangeContextWhich shared reference range flags use; the lab range on a result still wins; default the global context, else 'outpatient'
property / JSON attributepercentilesLegacy (use `curves`): Record<percentile, value per age in `ages`>, ages in months
property / JSON attributeagesLegacy (use `curves`): ages in months of `percentiles`; default [0,6,12,18,24,36]
attributeminLegacy: bottom of the y axis; default from the data
attributemaxLegacy: top of the y axis; default from the data
attributeunitLegacy (use `curves.unit`): unit label of the values ('kg')
attributedefault-checked / defaultChecked
property / JSON attributedefault-value / defaultValue
attributeauto-focus / autoFocus
eventco-standard-changeCalled with the new standard; the parent passes the matching `curves`. Without it, custom curves hide the switch; default none (React: onStandardChange)
slotnoteNote under the table; default how percentile bands are read Plain text also works as the `note` attribute.