suiss/uim · Chart

Line Chart Linear

A single line with straight segments between monthly readings.

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

One series with type="linear", so each month connects to the next with a straight segment. It has a month axis, a dashed grid and a tooltip.

Installation

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

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

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

Usage

import { LineChartLinear } from "@/components/charts/line-chart-linear"
<LineChartLinear />

Replace chartData with your records and change each dataKey to match your fields. Set the label and color in chartConfig. The component takes no props.