suiss/uim · Chart

Line Chart Multiple

Two lines comparing desktop and mobile visitors across six months, with a legend.

Line Chart Multiple 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
Line (multiple) on iOS in light mode

Desktop and mobile series drawn as monotone lines on the same axis. A legend below the plot names both series, and the tooltip lists each value for the touched month.

Installation

$ pnpm dlx @esuiss/uim@latest add line-chart-multiple

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/line-chart-multiple.tsx:

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

Usage

import { LineChartMultiple } from "@/components/charts/line-chart-multiple"
<LineChartMultiple />

Replace chartData with your records and change each dataKey to match your fields. Add a Line and a chartConfig entry for each extra series; the legend picks them up. The component takes no props.