explaingit

chartsorg/charts

28,002SwiftAudience · developerComplexity · 2/5MaintainedLicenseSetup · easy

TLDR

Swift library for adding interactive charts (line, bar, pie, radar) to iOS, tvOS, and macOS apps with extensive customization options.

Mindmap

mindmap
  root((Charts))
    What it does
      Line charts
      Bar charts
      Pie charts
      Radar charts
    How to use
      CocoaPods install
      Swift Package Manager
      Drop into Xcode
    Customization
      Colors animations
      Labels legends
      Highlight behavior
    Platforms
      iOS 12+
      tvOS 12+
      macOS 10.13+
    Data binding
      Realm support
      Live data
    Use cases
      Dashboards
      Finance apps

Things people build with this

USE CASE 1

Build a fitness tracker app that displays workout data with animated line charts.

USE CASE 2

Create a financial dashboard showing stock prices and portfolio performance with interactive bar and pie charts.

USE CASE 3

Add real-time analytics visualizations to a business intelligence app using Realm data binding.

USE CASE 4

Display sensor data or metrics in a tvOS app with customizable radar and line charts.

Tech stack

SwiftiOStvOSmacOSCocoaPodsCarthageSwift Package Manager

Getting it running

Difficulty · easy Time to first run · 5min
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

Charts is a library for drawing charts and graphs inside Apple apps, iOS on iPhone and iPad, tvOS on Apple TV, and macOS on the Mac. The description calls it "the Apple side of the crossplatform MPAndroidChart." MPAndroidChart is a popular charting library for Android by Philipp Jahoda, and this project is a Swift port that gives Apple developers the same set of charts with the same general API, so a team that already builds for Android can produce very similar-looking charts on Apple platforms without learning a completely different tool. Both Swift and Objective-C projects can use it, and the demo app is written in Objective-C to show that. Starting with version 5.0 the library was renamed from "Charts" to "DGCharts" to avoid name conflicts with Apple's own newer Swift Charts framework. The README highlights this as a breaking change and points readers at migration notes. It is distributed as an embedded framework and can be installed in several ways: CocoaPods with pod 'DGCharts', Carthage with prebuilt binaries, or Swift Package Manager by adding the GitHub URL as a dependency. There is also an optional companion package called ChartsRealm for integrating with the Realm.io database, kept as a separate dependency so you only link it if you need it. Third-party bindings exist for Xamarin. Supported platform versions listed are iOS 12.0 and up, tvOS 12.0 and up, and macOS 10.13 and up, with the master branch targeting Xcode 14 and Swift 5.7. The README also includes troubleshooting notes about Bridging Headers when mixing Swift and Objective-C, and links to many community tutorials and blog posts covering line charts, bar charts, radar charts, and SwiftUI integration. You would reach for this library when you are building an iOS, tvOS, or macOS app that needs to display non-trivial charts, especially if you already use MPAndroidChart on Android and want a consistent experience across both platforms. The full README is longer than what was provided.

Copy-paste prompts

Prompt 1
Show me how to add a line chart to an iOS app using DGCharts and populate it with sample data.
Prompt 2
How do I customize the colors, animations, and legend of a bar chart in DGCharts?
Prompt 3
Can you help me bind a DGCharts pie chart to live data from a Realm database?
Prompt 4
What's the difference between Charts and DGCharts, and which should I use in a new iOS project?
Prompt 5
How do I add a chart to an Objective-C iOS project using DGCharts with a bridging header?
Open on GitHub → Explain another repo

Generated 2026-05-21 · Model: sonnet-4-6 · Verify against the repo before relying on details.