suiss/uim · Chart

Bar Chart Hourly

A screen-time card with 24 hourly bars, a total in the header and a dashed average line.

Bar Chart Hourly 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
Bar (hourly) on iOS in light mode

Thin bars show minutes for each hour of the day, with ticks every six hours and a value axis in minutes on the right. A ReferenceLine marks the hourly average, and the header shows the day's total in hours and minutes. The tooltip formats the hour and the minutes.

Installation

$ pnpm dlx @esuiss/uim@latest add bar-chart-hourly

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/bar-chart-hourly.tsx:

uniwind/components/charts/bar-chart-hourly.tsx
import { Card, CardContent, CardHeader } from "@/components/ui/card"
import {
  Bar,
  BarChart,
  CartesianGrid,
  type ChartConfig,
  ChartContainer,
  ChartTooltip,
  ChartTooltipContent,
  ReferenceLine,
  XAxis,
  YAxis,
} from "@/components/ui/chart"
import { Text } from "@/components/ui/text"

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

Usage

import { BarChartHourly } from "@/components/charts/bar-chart-hourly"
<BarChartHourly />

Replace the 24 values in chartData with your hourly minutes; the total and average are calculated from it. The component takes no props.