https://github.com/ridvank/rkpiechart
Pie Chart written in Swift 3
https://github.com/ridvank/rkpiechart
chart pie piechart round swift3 table
Last synced: 2 months ago
JSON representation
Pie Chart written in Swift 3
- Host: GitHub
- URL: https://github.com/ridvank/rkpiechart
- Owner: ridvank
- License: mit
- Created: 2017-08-31T17:35:16.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-03T06:14:40.000Z (almost 8 years ago)
- Last Synced: 2025-03-19T22:16:37.007Z (3 months ago)
- Topics: chart, pie, piechart, round, swift3, table
- Language: Swift
- Homepage:
- Size: 500 KB
- Stars: 71
- Watchers: 5
- Forks: 12
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

[](http://cocoadocs.org/docsets/RKPieChart/)
[](https://travis-ci.org/ridvank/RKPieChart)
[](http://cocoapods.org/pods/RKPieChart)
[](https://raw.githubusercontent.com/ridvank/RKPieChart/master/LICENSE)
[](https://developer.apple.com/resources/)
[](https://developer.apple.com/swift)RKPieChart is super easy pie chart view written in Swift 3.
### Screenshots
![]()
![]()
![]()
![]()
### Animations

## Initalization
First of all single or multiple RKPieChartItem should be created. ```ratio``` and ```color``` are required but ```title``` variable is optional on init method.
```swift
let firstItem: RKPieChartItem = RKPieChartItem(ratio: 50, color: .orange, title: "1️⃣th Item ")
let secondItem: RKPieChartItem = RKPieChartItem(ratio: 30, color: .gray, title: "2️⃣nd Item")
let thirdItem: RKPieChartItem = RKPieChartItem(ratio: 20, color: .yellow, title: "3️⃣th Item")
```
Initalization is also simple; ```items``` variable is required and ```centerTitle``` variable is optional.
```swift
let chartView = RKPieChartView(items: [firstItem, secondItem, thirdItem], centerTitle: "I am title 🕶")
```
You can change background color of the pie chart circle:
```swift
chartView.circleColor = .green
```
To change the arc width of the chart:
```swift
chartView.arcWidth = 60
```
You can also give indensity to the chart by updating ```isIntensityActivated``` variable. ```false``` is the default behaviour.
```swift
chartView.isIntensityActivated = true
```
You can update the style of the pie chart. 3 types supported. ```butt```,```square``` and ```round```. If you have 1 item to show you can choose all of them. However If you have multiple item ```round``` and ```square``` not supported.
```swift
chartView.style = .butt
```
You can hide the ```RKPieChart``` item title if you want by using:
```swift
chartView.isTitleViewHidden = false
```
You can animate ```RKPieChart``` view if you want by using:
```swift
chartView.isAnimationActivated = true
```
Default type is ```false``` which means no animation will be executed.## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
* Xcode 8
* iOS 9.0+## Installation
RKPieChart is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod "RKPieChart"
```## Author
Ridvan Kuccuk, [email protected]
## License
RKPieChart is available under the MIT license. See the LICENSE file for more info.