Demo-implementation of 5 different Chart Libraries in SwiftUI

Overview

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.

You might also like...
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

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

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

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

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

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

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

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

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

Owner
Jannik Arndt
Scala Dev
Jannik Arndt
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

柳东原 · Dongyuan Liu 1.2k Nov 29, 2022
A SwiftUI Contribution Chart (GitHub-like) implementation package

ContributionChart A contribution chart (aka. heatmap, GitHub-like) library for iOS, macOS, and watchOS. 100% written in SwiftUI. It Supports Custom Bl

null 41 Dec 27, 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

Kevin 1.4k Nov 7, 2022
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

Johnny Wu 416 Dec 31, 2022
SSLineChart provides you with the additional functionality of gradient color fill which cannot be found in any library specially Watchkit Libraries.

SSLineChart SSLineChart draws a UIImage of a chart with given values and provide additional functionality of gradient color fill. Setup Instructions C

Simform Solutions 42 Aug 23, 2022
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

Roman Baitaliuk 158 Jan 6, 2023
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

Jonathan Gander 59 Dec 10, 2022
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

RiuHDuo 24 Oct 2, 2022
Fully customizable line chart for SwiftUI 🀩

?? CheesyChart Create amazing Crypto and Stock charts ?? ?? Looking for an easy to use and fully customizable charting solution written in SwiftUI? Th

adri567 13 Dec 14, 2022
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

TBXark 203 Dec 28, 2022