suiss/uim · Chart

Pie Chart Half

A half-circle donut showing battery use by device, with a total under the arc.

Pie Chart Half 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
Pie (half) on iOS in light mode

A PieChart drawn from 180 to 0 degrees, with rounded, spaced slices. chartData holds a percentage share per device. A centered Text shows the 100% total, and the tooltip uses a custom formatter to print each share as a percentage.

Installation

$ pnpm dlx @esuiss/uim@latest add pie-chart-half

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/pie-chart-half.tsx:

uniwind/components/charts/pie-chart-half.tsx
import { View } from "react-native"
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import {
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
  Pie,
  PieChart,
} from "@/components/ui/chart"
  1. Update the import paths to match your project.

Usage

import { PieChartHalf } from "@/components/charts/pie-chart-half"
<PieChartHalf />

Replace chartData with your shares and update chartConfig and the caption under the arc. The component takes no props.