AreaStackChart
The AreaStackChart component displays a series of values as stacked areas over a shared axis, allowing for a clear comparison of data parts and totals across categories or time.
Usage
Props
marks: Array<object> (required)
An array of data points to render on the chart.
Each mark supports the following properties:
-
category: stringA category label for the mark, typically used to group data in the stacked chart. -
label: string | DateThe x-axis label for this mark. Can be a year, date, or other descriptor. -
value: numberThe numeric value to be represented by the mark. -
unit?: CalendarComponentSpecifies the calendar component for time-based values (e.g.,"year","month","day"). Useful when rendering time series. -
stacking?: ChartMarkStackingMethodControls how marks are stacked:"standard": Stack values from a common baseline (default)."normalized": Normalize all values to represent a percentage of the total."center": Stack around a central axis for symmetrical data."unstacked": Render without stacking.
-
Other optional
ChartMarkProps: Includes extensive styling and behavior options such as:foregroundStyleopacitycornerRadiusinterpolationMethodsymbol,symbolSize,annotation,clipShape,shadow,blur,zIndex,offset, etc.
Refer to ChartMarkProps for detailed mark customization.
labelOnYAxis?: boolean
Whether to display the label values on the Y-axis instead of the default X-axis.
Defaults to false.
