# swift-charts

A skill that steers your coding agent through Swift Charts work on iOS 26+. Useful for bars, lines, donuts, heat maps and 3D surfaces.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 4000 installs · ★ 1237
- Author: dpearson2699
- License: LicenseRef-Unknown · policy=link-only · description only; the file stays with the author
- Source: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/swift-charts/SKILL.md
- Updated: 2026-07-31
- HTML: https://affpapa.org/en/nevibecode/skills/swift-charts

## What it does

The skill covers Swift Charts end to end: composing marks inside `Chart` or `Chart3D`, configuring axes and scales with view modifiers, adding selection, scrolling, annotations and a legend. Separate sections handle vectorized plots (`BarPlot`, `LinePlot`, `AreaPlot`, `PointPlot`) and 3D ones (`Chart3D`, `SurfacePlot`).

It walks through a workflow: define data as an `Identifiable` struct, pick mark types, encode visual channels with `.foregroundStyle(by:)`, `.symbol(by:)` and `.lineStyle(by:)`, then set scale domains. There is also a review checklist and a list of common mistakes. Past 1000 2D points, the skill points you at vectorized plots.

Targets start at iOS 26+, so some examples (`SectorMark`, `Chart3D`) will not compile on older deployment targets. One trap worth knowing: `SectorMark` expects strictly positive values, so zeros and negatives have to be filtered or explained outside the pie. Longer recipes live in `references/charts-patterns.md`.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swift-charts -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/swift-charts/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/swift-charts/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swift-charts -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/swift-charts/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swift-charts -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/swift-charts/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install dpearson2699/swift-ios-skills swift-charts
```

2. **Manually: put the files in place**
- File: `.github/skills/swift-charts/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swift-charts -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/swift-charts
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/swift-charts/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swift-charts -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/swift-charts/SKILL.md

## When to use it
- build a monthly revenue bar chart
- add tap selection and an annotation to a chart point
- render a donut with a custom inner radius
- draw a Gantt chart from interval bars
- plot a 3D surface from spatial data

## Example prompts
- build a monthly revenue chart with Swift Charts
- add segment selection to this donut and annotate the picked slice
- rewrite this chart as a vectorized LinePlot, there are over a thousand points

## Similar
- [guide-swiftui-charts](https://affpapa.org/en/nevibecode/skills/guide-swiftui-charts.md) — skill · 429 installs
- [clerk-swift](https://affpapa.org/en/nevibecode/skills/clerk-swift.md) — skill · 14500 installs
- [swift-expert](https://affpapa.org/en/nevibecode/skills/swift-expert.md) — skill · 4100 installs
- [swift-architecture-skill](https://affpapa.org/en/nevibecode/skills/swift-architecture-skill.md) — skill · 2000 installs
- [ios-swift-development](https://affpapa.org/en/nevibecode/skills/ios-swift-development.md) — skill · 1500 installs
- [axiom-swift](https://affpapa.org/en/nevibecode/skills/axiom-swift.md) — skill · 1200 installs

From the same set: [dpearson2699/swift-ios-skills](https://affpapa.org/en/nevibecode/by/dpearson2699/swift-ios-skills.md) — 86 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
