suiss/uim · Chart

Line Chart Dots

A weight card with a straight-line trend, dots on each month and the latest value in the header.

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

Ten monthly weights drawn with type="linear" and a dot on every reading, plus a larger dot for the touched point. A value axis on the right covers a fixed range, and the tooltip formats values in kilograms. The header shows the latest weight and the change since January as static text.

Installation

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

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

Manual

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

  2. Copy the source into components/charts/line-chart-dots.tsx:

uniwind/components/charts/line-chart-dots.tsx
import { View } from "react-native"
import { Card, CardContent, CardHeader } from "@/components/ui/card"
import {
  CartesianGrid,
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
  Line,
  LineChart,
  XAxis,
  YAxis,
} from "@/components/ui/chart"
import { Text } from "@/components/ui/text"

const MONTHS = [
  1. Update the import paths to match your project.

Usage

import { LineChartDots } from "@/components/charts/line-chart-dots"
<LineChartDots />

Replace the weight array in chartData and update the header text to match. Adjust the YAxis domain and ticks for your range. The component takes no props.