Latest 0.0.4
Homepage https://github.com/Dwarven/DYPieChartView
License MIT
Platforms ios 7.0
Authors

CocoaPods Compatible
Platform
Twitter
License

Animated Pie Chart using Custom CALayer.

Preview

lineWidth:Defaults to nil

Demo Gif

lineWidth:10

Demo Gif

Podfile

To integrate DYPieChartView into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'DYPieChartView'

How to use

#import "DYPieChartView.h"

#define MakeColor(r, g, b) [UIColor colorWithRed:(r/255.0f) green:(g/255.0f) blue:(b/255.0f) alpha:1.0f]

#pragma mark - init and setup DYPieChartView
_pieChartView = [[DYPieChartView alloc] initWithFrame:CGRectMake(0, 0, 300, 300)];
//_pieChartView.backgroundColor = [UIColor lightGrayColor];
_pieChartView.startAngle = -M_PI/2;
_pieChartView.clockwise = NO;
_pieChartView.lineWidth = @(10);
_pieChartView.center = self.view.center;
_pieChartView.sectorColors = @[MakeColor(120, 110, 230),
                               MakeColor(110, 240, 190),
                               MakeColor(10, 220, 230),
                               MakeColor(240, 140, 10),
                               MakeColor(230, 10, 100)];
[self.view addSubview:_pieChartView];

#pragma mark - animations
//type 1: for duration
[_pieChartView animateToScaleValues:@[@(0.4), @(0.35), @(0.25), @(0.0), @(0.0)]
                           duration:2];
//type 2: quickly
[_pieChartView setScaleValues:@[@(0.4), @(0.35), @(0.25), @(0.0), @(0.0)];

Latest podspec

{
    "name": "DYPieChartView",
    "version": "0.0.4",
    "summary": "Animated Pie Chart using Custom CALayer.",
    "homepage": "https://github.com/Dwarven/DYPieChartView",
    "platforms": {
        "ios": "7.0"
    },
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Dwarven": "[email protected]"
    },
    "social_media_url": "https://twitter.com/DwarvenYang",
    "source": {
        "git": "https://github.com/Dwarven/DYPieChartView.git",
        "tag": "0.0.4"
    },
    "source_files": "Class/*.{h,m}"
}

Pin It on Pinterest

Share This