suiss/uim · Chart

Bar Chart Negative

Monthly cash flow bars above and below a zero line, green for gains and red for losses.

Bar Chart Negative is an open-source mobile chart from suiss/uim, drawn with react-native-svg for React Native and Expo, with SwiftUI and Jetpack Compose versions built from the same design tokens. The @esuiss/uim CLI copies its source into your project, so you own the code.

iOS
Bar (negative) on iOS in light mode

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

$ pnpm dlx @esuiss/uim@latest add bar-chart-negative

The CLI also adds what it builds on: Card, Chart.

Manual

  1. Add the pieces it builds on: Card, Chart.

  2. Copy the source into components/charts/bar-chart-negative.tsx:

uniwind/components/charts/bar-chart-negative.tsx
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  Bar,
  BarChart,
  CartesianGrid,
  Cell,
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
  1. Update the import paths to match your project.

Usage

import { BarChartNegative } from "@/components/charts/bar-chart-negative"
<BarChartNegative />

Replace chartData with your months and signed flow values. Change the colors in the Cell fill expression. The component takes no props.