SwiftUI Charts
  • July 4, 2025

Build custom charts with SwiftUI

Styles

 

 

 

Chart(data: [0.1, 0.3, 0.2, 0.5, 0.4, 0.9, 0.1])
.chartStyle(
LineChartStyle(.quadCurve, lineColor: .blue, lineWidth: 5)
)

Area

Chart(data: [0.1, 0.3, 0.2, 0.5, 0.4, 0.9, 0.1])
.chartStyle(
AreaChartStyle(.quadCurve, fill:
LinearGradient(gradient: .init(colors: [Color.blue.opacity(0.2), Color.blue.opacity(0.05)]), startPoint: .top, endPoint: .bottom)
)
)

Stacked Area

Chart(data: matrix)
.chartStyle(
StackedAreaChartStyle(.quadCurve, colors: [.yellow, .orange, .red])
)

Column

Chart(data: [0.1, 0.3, 0.2, 0.5, 0.4, 0.9, 0.1])
.chartStyle(
ColumnChartStyle(column: Capsule().foregroundColor(.green), spacing: 2)
)

Install


AddΒ ChartsΒ to your project with Swift Package Manager

// swift-tools-version:5.1
import PackageDescription

let package = Package(
name: “YOUR_PROJECT”,
dependencies: [
.package(url: “https://github.com/spacenation/swiftui-charts.git”, from: “1.0.0”),
]
)

GitHub


View Github

#chart #ios #macos #swift
YOU MIGHT ALSO LIKE...
SwiftUICharts

A simple line and bar charting library that support accessibility written using SwiftUI.

Swipeable cards

Swipeable Cards with SwiftUI

RGStack

This UI attempts to capture the Quibi Card Stack and the associated User Interaction.

πŸƒ CardStack

A easy-to-use SwiftUI view for Tinder like cards on iOS, macOS & watchOS.

SlideOverCard

A SwiftUI card design similar to the one used by Apple in HomeKit, AirPods, Apple Card and AirTag setup, NFC ...