suiss/ui · Chart
Line Chart Goal Dots
Nightly sleep hours with a goal line and dots colored green or orange depending on whether the goal was met.
Line Chart Goal Dots is an open-source chart from suiss/ui for React, React Native, SwiftUI and Jetpack Compose. The @esuiss/ui CLI copies its source into your project, so you own the code.
Nightly sleep plotted against a dashed goal line, with each dot colored green if the goal was met and orange if not. Pick it over the plain goal chart when readers should spot hits and misses at a glance.
Installation
CLI
Works in any project with a components.json. See Installation for the one-line registry setup. Or use the suiss/ui CLI:
Manual
- Install the dependencies:
-
Copy the source into
components/charts/line-chart-goal-dots.tsx:
- Update the import paths to match your project.
Usage
Replace chartData and set GOAL to your target; dot colors update from the comparison automatically. Adjust the value axis domain and ticks to your range, and change the two dot colors in the custom dot renderer.
Notes
The headline figure is hard-coded text, not computed from the data, so wire it up when you plug in real values. Color alone marks hit or miss on the chart, so keep a text explanation like the one in the header.

Seven nights of sleep drawn as a monotone line. The dot prop is a function that colors each point by comparing it with GOAL, and a dashed green ReferenceLine marks the goal itself. The tooltip formats values as hours and minutes.
Installation
The CLI also adds what it builds on: Card, Chart, Text.
Manual
-
Target iOS 17 or later.
-
Copy the theme files every view uses:
- Copy the source and every file it uses:
- Add the files to your app target.
- Set
minSdkto 24 or higher and add the dependencies:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Update the
com.esuiss.uipackage names to match your project.
Usage
Replace chartData with your nightly hours and set GOAL. The header average is static text, so update it with your own value. The component takes no props.
