suiss/ui · Chart
Bar Chart Stacked
Two series stacked into one bar per month, with a legend below the plot.
Bar Chart Stacked is an open-source chart from suiss/ui for React, React Native, SwiftUI and Jetpack Compose. The @esuiss/ui CLI copies its source into your project, so you own the code.
Two series stacked into one bar per month, with a legend under the plot. Use it when the total per month matters as well as how each series contributes to it.
Installation
CLI
Works in any project with a components.json. See Installation for the one-line registry setup. Or use the suiss/ui CLI:
Manual
- Install the dependencies:
-
Copy the source into
components/charts/bar-chart-stacked.tsx:
- Update the import paths to match your project.
Usage
Replace chartData and rename the series keys in the data, both Bar elements and chartConfig. Every bar in the stack needs the same stackId; the first one sits at the bottom. If you add a series, move the rounded top corners via radius to whichever bar is on top.
Notes
The legend takes labels and colors from the config. Focus the chart and use the arrow keys to move between months.

Desktop and mobile bars share a stackId, so each column shows both parts and their total. Only the outer corners are rounded, and a legend below the plot names both series.
Installation
The CLI also adds what it builds on: Card, Chart.
Manual
-
Target iOS 17 or later.
-
Copy the theme files every view uses:
- Copy the source and every file it uses:
- Add the files to your app target.
- Set
minSdkto 24 or higher and add the dependencies:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Update the
com.esuiss.uipackage names to match your project.
Usage
Replace chartData with your records and change each dataKey to match your fields. Add, rename or recolor series in chartConfig and add a Bar for each. The component takes no props.
