Welcome to the SwiftUI Charts API Examples repository!
This collection of projects demonstrates how to build beautiful and interactive data visualizations using Apple's native Charts framework, introduced in iOS 16.
Whether you're new to SwiftUI or looking to sharpen your charting skills, this repo offers practical, real-world examples you can reference or use directly in your projects.
- β Basic Line, Bar, Area, and Point Charts
- β Combining Multiple Chart Types
- β Custom Styling and Theming
- β Annotations, Rule Marks, and Overlays
- β Handling Touch Events and Gestures
- β Interactive Tooltips and Data Highlights
- β Real-World Use Cases (e.g., Temperature Trends, Sales Dashboards)
Each example is self-contained in its own SwiftUI View file and includes mock data.
- Xcode 14+
- iOS 16+ (Charts API is not available on earlier versions)
- Swift 5.7+
- Clone this repository:
git clone https://github.com/your-username/swiftui-charts-examples.git cd swiftui-charts-examples - Open the project in Xcode
- Build and run on a simulator or real device running iOS 16 or newer.