suiss/uim · Chart

Pie Chart Nested

Two concentric pie rings: summary groups in the center and per-device detail around them.

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

A PieChart with two Pie layers. The inner pie reads a groups array and is drawn at reduced opacity; the outer ring reads chartData, one record per device. Pressing a slice in either ring shows a tooltip.

Installation

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

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

uniwind/components/charts/pie-chart-nested.tsx
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 { PieChartNested } from "@/components/charts/pie-chart-nested"
<PieChartNested />

Replace groups and chartData with your summary and detail records, and add each name to chartConfig with its label and color. The component takes no props.