Skip to content

maheenkhalid/SwiftUIChartsExamples

Repository files navigation

πŸ“Š SwiftUI Charts API Examples

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.


πŸš€ Features Covered

  • βœ… 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)

πŸ“‚ Structure

Each example is self-contained in its own SwiftUI View file and includes mock data.


πŸ›  Requirements

  • Xcode 14+
  • iOS 16+ (Charts API is not available on earlier versions)
  • Swift 5.7+

πŸ”§ How to Run

  1. Clone this repository:
    git clone https://github.com/your-username/swiftui-charts-examples.git
    cd swiftui-charts-examples
  2. Open the project in Xcode
  3. Build and run on a simulator or real device running iOS 16 or newer.

About

Example code for setting up various kinds of Charts in SwiftUI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages