suiss/ui · Chart
Bar Chart Negative
Monthly cash flow bars that turn green above zero and red below it, with a zero baseline.
Bar Chart Negative 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.
Monthly cash flow where bars rise green above a zero line and drop red below it. Use it for any value that can be negative, such as profit, net change or deltas against a target.
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-negative.tsx:
- Update the import paths to match your project.
Usage
Replace chartData with your values and rename flow in the data, the bar and chartConfig. The color for each bar is chosen per Cell based on its sign, so change the two colors there. Set interval on the axis to show more or fewer month labels.
Notes
Because colors are set per bar instead of in the config, the tooltip has no color swatch, and green and red alone carry the sign; keep the zero line so the direction is clear without color. Focus the chart and use the arrow keys to move between months.

One bar per month, colored per value through a Cell: green when the flow is positive and red when it is negative. A ReferenceLine at zero anchors the bars, and the month axis shows every other label.
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 months and signed flow values. Change the colors in the Cell fill expression. The component takes no props.
