Demo-implementation of 5 different Chart Libraries in SwiftUI

Last update: May 1, 2022

Comparison of Chart Libraries for SwiftUI


Read the entire blog post including images on jannikarndt.de!


I want to add charts to my SwiftUI iOS App, Zettl. For that, I am going to compare the following libraries:

Requirements

My needs are

  • bar charts for categorial data. Extra: I need images as labels.
  • line charts for time-scale data. With multiple lines. Bonus points if I don't have to care about the time distribution, i.e. can enter timestamps and they are spread correctly.
  • pie charts for relative comparisons. Here, the magic lies in good annotations.

SwiftCharts

Supported Chart Types

  • Bar Charts
  • Line Charts (didn't check)
  • Donut Charts (didn't check)
  • more

Code

Result

  • integration of UIView in SwiftUI sucks
  • Docs don't help a lot
  • Examples are very complex

Stock-Charts

Supported Chart Types

  • Bar Charts => as "Capsule" Charts, for one value only
  • Line Charts: without axis, only for this one specific use-case 🆗
  • Pie Charts:

Code

Result

  • Super easy to integrate
  • But very limited to this one use case
  • The code offers some good inspiration to base upon

SwiftUI Charts

Supported Chart Types

  • Bar Charts, also stacked, not no axis or labels 😬
  • Very simple line charts 🆗
  • No pie charts

Code

Result

  • Easy to integrate
  • But quite buggy
  • No axis-options

AppPear/ChartView

Supported Chart Types

  • Bar Charts (no axis though)
  • Line Charts (with multiple lines, no axis)
  • Pie Charts (no labels)

Code

Result

  • Nice library for that particular style, but cannot be changed to view axis / labels / more things

danielgindi/Charts

Supported Chart Types

  • Bar Charts (even horizontal, with every option you can think of)
  • Line Charts
  • Pie Charts

Code

Result

  • By far the most comprehensive library
  • No docs, references the Android docs, but good amount of demos
  • Many third-party tutorials, for example this one that explains the integration into SwiftUI
  • The amount of options is a little overwhelming, and the defaults are insane, so you have to go through the options.

Conclusion

I was close to building my own version of the required charts, until I tried danielgindi/Charts. While it is a heavyweight, I will give it a shot.

You can try out the demo-app with all five libraries here: https://github.com/JannikArndt/SwiftUI-Charts-Playground.

GitHub

https://github.com/JannikArndt/SwiftUI-Charts-Playground
You might also like...

A simple and animated Pie Chart for your iOS app.

XYPieChart XYPieChart is an simple and easy-to-use pie chart for iOS app. It started from a Potion Project which needs an animated pie graph without i

May 16, 2022

iOS/iPhone/iPad Chart, Graph. Event handling and animation supported.

iOS/iPhone/iPad Chart, Graph. Event handling and animation supported.

#EChart A highly extendable, easy to use chart with event handling, animation supported. ##Test How To Use Download and run the EChartDemo project is

Apr 20, 2022

FSLineChart A line chart library for iOS.

FSLineChart  A line chart library for iOS.

FSLineChart A line chart library for iOS. Screenshots Installing FSLineChart Add the contents of the FSLineChart project to your directory or simply a

May 10, 2022

ANDLineChartView is easy to use view-based class for displaying animated line chart.

ANDLineChartView is easy to use view-based class for displaying animated line chart.

ANDLineChartView for iOS ANDLineChartView is easy to use view-based class for displaying animated line chart. Usage API is simple. Just implement foll

Jan 31, 2022

Flower-like chart written in Swift

Flower-like chart written in Swift

FlowerChart - custom chart written in Swift Fully vector flower-shaped chart written in Swift Flower-shaped chart written in Swift, this repo is a sam

Jun 9, 2021

This is pie chart that is very easy to use and customizable design.

This is pie chart that is very easy to use and customizable design.

CSPieChart Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements Installation CSPieCh

Sep 20, 2021

Easy to use Spider (Radar) Chart library for iOS written in Swift.

Easy to use Spider (Radar) Chart library for iOS written in Swift.

DDSpiderChart Easy to use Spider (Radar) Chart library for iOS written in Swift. Requirements iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+ Xcode

Oct 29, 2021

Draw a chart with progress bar style

Draw a chart with progress bar style

ChartProgressBar-iOS Draw a chart with progress bar style - the android version here Installation iOS version (9.0,*) Swift 3.2 Using cocoapods : pod

Apr 25, 2022

Line Chart library for iOS written in Swift

Line Chart library for iOS written in Swift

Swift LineChart Usage var lineChart = LineChart() lineChart.addLine([3, 4, 9, 11, 13, 15]) Features Super simple Highly customizable Auto scaling Touc

May 13, 2022
Simple and intuitive iOS chart library. Contribution graph, clock chart, and bar chart.
Simple and intuitive iOS chart library. Contribution graph, clock chart, and bar chart.

TEAChart Simple and intuitive iOS chart library, for Pomotodo app. Contribution graph, clock chart, and bar chart. Supports Storyboard and is fully ac

May 19, 2022
A simple and beautiful chart lib used in Piner and CoinsMan for iOS(https://github.com/kevinzhow/PNChart) Swift Implementation

PNChart-Swift PNChart(https://github.com/kevinzhow/PNChart) Swift Implementation Installation This isn't on CocoaPods yet, so to install, add this to

Apr 21, 2022
an iOS open source Radar Chart implementation
an iOS open source Radar Chart implementation

JYRadarChart an open source iOS Radar Chart implementation ##Screenshots Requirements Xcode 5 or higher iOS 5.0 or higher ARC CoreGraphics.framework D

May 3, 2022
SwiftUI Bar Chart
SwiftUI Bar Chart

SwiftUI BarChart Lightweight and easy to use SwiftUI chart library for all Apple platforms Features Scaling on both axes Fully customizable axes (labe

May 6, 2022
An interactive line chart written in SwiftUI with many customizations.

LineChartView LineChartView is a Swift Package written in SwiftUI to add a line chart to your app. It has many available customizations and is interac

May 17, 2022
A SwiftUI Framework for Drawing Chart
A SwiftUI Framework for Drawing Chart

PrettyAxis A SwiftUI Framework for drawing charts. Fearture Support Drawing Bar Chart RadarChart Line Chart and Scatter Charts Pie Chart and Donut Cha

May 16, 2022
TKRadarChart - A customizable radar chart in Swift
 TKRadarChart - A customizable radar chart  in Swift

TKRadarChart A customizable radar chart in Swift Requirements iOS 8.0+ Xcode 9.0 Swift 4.0 Installation CocoaPods You can use CocoaPods to install TKR

Jan 29, 2022
A powerful 🚀 Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, panning and animations.
A powerful 🚀 Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, panning and animations.

⚡ A powerful & easy to use chart library for Android ⚡ Charts is the iOS version of this library Table of Contents Quick Start Gradle Maven Documentat

May 21, 2022
A simple and beautiful chart lib used in Piner and CoinsMan for iOS
A simple and beautiful chart lib used in Piner and CoinsMan for iOS

PNChart You can also find swift version at here https://github.com/kevinzhow/PNChart-Swift A simple and beautiful chart lib with animation used in Pin

May 15, 2022
iOS Chart. Support animation, click, scroll, area highlight.
iOS Chart. Support animation, click, scroll, area highlight.

XJYChart XJYChart - A High-performance, Elegant, Easy-to-integrate Charting Framework. The Best iOS Objc Charts. chart more beautiful support chart sc

May 18, 2022