suiss/uim · Chart

Area Chart Stacked

Two stacked areas showing desktop and mobile visitors combined, with a legend.

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

Desktop and mobile areas are stacked on top of each other with the same stackId, so the top edge shows the combined total. A legend below the plot names both series, and the tooltip lists each value with a dot indicator.

Installation

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

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.tsx:

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

Usage

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

Replace chartData with your records and change each dataKey to match your fields. Add, rename or recolor series in chartConfig; the legend picks the changes up. The component takes no props.