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

Related tags

Charts CSPieChart
Overview

CSPieChart

Carthage compatible Version License iOS 8.3+ Swift 4.2+

Example

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

Requirements

Installation

CSPieChart is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "CSPieChart"

Useage

First Step - import CSPieChart to your project

Second Step - You should CSPieChartData. This is model for piechart.

  let data = CSPieChartData(key: "test", value: 70)

Third Step - Add a delegate CSPieChartDataSource & CSPieChartDelegate to your class & add two delegate methods

public protocol CSPieChartDataSource {

    ///  Component data
    func numberOfComponentData() -> Int
    func pieChart(_ pieChart: CSPieChart, dataForComponentAt index: Int) -> CSPieChartData

    ///  Component colors
    func numberOfComponentColors() -> Int
    func pieChart(_ pieChart: CSPieChart, colorForComponentAt index: Int) -> UIColor

    ///  If you are implement this, you can show subView. example) 'UIImageView' or 'UILable'
    @objc optional func numberOfComponentSubViews() -> Int
    @objc optional func pieChart(_ pieChart: CSPieChart, viewForComponentAt index: Int) -> UIView

    ///  If you are implement this, you apply color to line path
    ///  Otherwish line color is applied default 'black'
    @objc optional func numberOfLineColors() -> Int
    @objc optional func pieChart(_ pieChart: CSPieChart, lineColorForComponentAt index: Int) -> UIColor
}
public protocol CSPieChartDelegate {

    /// Component select
    @objc optional func pieChart(_ pieChart: CSPieChart, didSelectComponentAt index: Int)
}

You can set some options

    //  Pie chart radius rate that is percentage of frames in the superview. default is 0.7
    public var pieChartRadiusRate: CGFloat = 0.7
    
    // Pie chart line length between component and subview. default is 10
    public var pieChartLineLength: CGFloat = 10
    
    //  This is piechart component selecting animation. default is none
    public var seletingAnimationType: SelectingAnimationType = .none
}

Last Step - You must call show.

Example

  func ViewDidLoad(...) {
      ....
      pieChart.show(animated: true)
  }

If you need more information, check example

Author

chansim.youk, [email protected]

License

CSPieChart is available under the MIT license. See the LICENSE file for more info.

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

Fully customizable line chart for SwiftUI 🤩
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

 SwiftCharts - Easy to use and highly customizable charts library for iOS
SwiftCharts - Easy to use and highly customizable charts library for iOS

SwiftCharts Easy to use and highly customizable charts library for iOS Features: Bars - plain, stacked, grouped, horizontal, vertical Scatter Lines (s

Dr-Charts Easy to use, customizable and interactive charts library for iOS in Objective-C
Dr-Charts Easy to use, customizable and interactive charts library for iOS in Objective-C

dr-charts Easy to use, customizable and interactive charts library for iOS in Objective-C Features: Multiple chart types Line / Multiple lines / Lines

FLCharts: Easy to use and highly customizable charts library for iOS
FLCharts: Easy to use and highly customizable charts library for iOS

FLCharts Requirements Xcode 11 / Swift 5 iOS = 11.0 Installation FLCharts is av

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

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/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

Using Swift Charts and Voiceover Chart Descriptor to compose music. 🤯
Using Swift Charts and Voiceover Chart Descriptor to compose music. 🤯

Chart de lune 🎵 Using Swift Charts and Voiceover Chart Descriptor to compose music. 🤯 Image source: https://hadikarimi.com/portfolio/claude-debussy-

Releases(1.0)
Owner
iOSCS
iOS Programmer
iOSCS
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
Easy to use and highly customizable pie charts library for iOS

PieCharts Easy to use and highly customizable pie charts library for iOS Swift 4.2, iOS 8+ Video Features: Customizable slices Add overlays using simp

null 503 Dec 6, 2022
Easy to use and highly customizable pie charts library for iOS

PieCharts Easy to use and highly customizable pie charts library for iOS Swift 4.2, iOS 8+ Video Features: Customizable slices Add overlays using simp

null 503 Dec 6, 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 & easy to use chart library for Android âš¡ Charts is the iOS version of this library Table of Contents Quick Start Gradle Maven Documentat

Philipp Jahoda 36k Jan 5, 2023
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

XY Feng 1.7k Sep 6, 2022
A simple pie chart for iOS.

EGPieChart Installation EGPieChart is available through CocoaPods. To install it, simply add the following line to your Podfile: pod 'EGPieChart' manu

Ethan Guan 3 Nov 29, 2021
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

Andrzej Naglik 421 Dec 11, 2022
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

Deniz Adalar 82 Nov 14, 2022
MSBBarChart is an easy to use bar chart library for iOS

MSBBarChart MSBBarChart is an easy to use bar chart library for iOS. Usage if you want to hide label above bar barChart.setOptions([.isHiddenLabelAbov

misyobun 45 May 3, 2022
JTChartView is the new lightweight and fully customizable solution to draw a chart

JTChartView JTChartView is the new lightweight and fully customizable solution to draw a curve and fill the space underneath it with a gradient. The r

Jakub Truhlář 124 Sep 7, 2022