suiss/uim · Chart

Area Chart Stacked Expand

Two stacked areas normalized so every month adds up to 100%, showing each series' share.

Area Chart Stacked Expand 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
Area (stacked expand) on iOS in light mode

Desktop and mobile areas share one stack with stackOffset="expand", so the chart shows the proportion of each series rather than raw totals. A value axis on the right reads 0%, 50% and 100%, and the tooltip lists both series.

Installation

$ pnpm dlx @esuiss/uim@latest add area-chart-stacked-expand

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/area-chart-stacked-expand.tsx:

uniwind/components/charts/area-chart-stacked-expand.tsx
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  Area,
  AreaChart,
  CartesianGrid,
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
  XAxis,
  1. Update the import paths to match your project.

Usage

import { AreaChartStackedExpand } from "@/components/charts/area-chart-stacked-expand"
<AreaChartStackedExpand />

Replace chartData with your records and change each dataKey to match your fields. Rename the series or change their colors in chartConfig. The component takes no props.