Kevin

Merge pull request #50 from moflo/master

Updated circle chart API
... ... @@ -3,7 +3,7 @@ Pod::Spec.new do |s|
s.version = "0.2.2"
s.summary = "A simple and beautiful chart lib with animation used in Piner for iOS"
s.homepage = "https://github.com/kevinzhow/PNChart"
s.homepage = "https://github.com/moflo/PNChart"
s.screenshots = "https://github-camo.global.ssl.fastly.net/ea8565b7a726409d5966ff4bcb8c4b9981fb33d3/687474703a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f313539393636322f706e63686172742e706e67"
s.license = { :type => 'MIT', :file => 'LICENSE' }
... ... @@ -11,12 +11,12 @@ Pod::Spec.new do |s|
s.author = { "Kevin" => "kevinchou.c@gmail.com" }
s.platform = :ios, '6.0'
s.source = { :git => "https://github.com/kevinzhow/PNChart.git", :tag => s.version.to_s }
s.source = { :git => "https://github.com/moflo/PNChart.git" }
s.ios.dependency 'UICountingLabel', '~> 1.0.0'
s.source_files = 'PNChartDemo/PNChart/**/*.{h,m}'
s.public_header_files = 'PNChartDemo/PNChart/**/*.h'
s.source_files = 'PNChart/*.{h,m}'
s.public_header_files = 'PNChart/*.h'
s.frameworks = 'CoreGraphics', 'UIKit', 'Foundation', 'QuartzCore'
s.requires_arc = true
end
... ...
... ... @@ -15,7 +15,7 @@
@interface PNCircleChart : UIView
- (void)strokeChart;
- (id)initWithFrame:(CGRect)frame andTotal:(NSNumber *)total andCurrent:(NSNumber *)current andClockwise:(BOOL)clockwise;
- (id)initWithFrame:(CGRect)frame andTotal:(NSNumber *)total andCurrent:(NSNumber *)current andClockwise:(BOOL)clockwise andShadow:(BOOL)hasBackgroundShadow;
@property (nonatomic) UIColor *strokeColor;
@property (nonatomic) UIColor *labelColor;
... ...
... ... @@ -27,7 +27,7 @@
}
- (id)initWithFrame:(CGRect)frame andTotal:(NSNumber *)total andCurrent:(NSNumber *)current andClockwise:(BOOL)clockwise
- (id)initWithFrame:(CGRect)frame andTotal:(NSNumber *)total andCurrent:(NSNumber *)current andClockwise:(BOOL)clockwise andShadow:(BOOL)hasBackgroundShadow
{
self = [super initWithFrame:frame];
... ... @@ -55,7 +55,7 @@
_circleBG.lineCap = kCALineCapRound;
_circleBG.fillColor = [UIColor clearColor].CGColor;
_circleBG.lineWidth = [_lineWidth floatValue];
_circleBG.strokeColor = PNLightYellow.CGColor;
_circleBG.strokeColor = (hasBackgroundShadow ? PNLightYellow.CGColor : [UIColor clearColor].CGColor);
_circleBG.strokeEnd = 1.0;
_circleBG.zPosition = -1;
... ...
... ... @@ -129,12 +129,18 @@
circleChartLabel.font = [UIFont fontWithName:@"Avenir-Medium" size:23.0];
circleChartLabel.textAlignment = NSTextAlignmentCenter;
PNCircleChart * circleChart = [[PNCircleChart alloc] initWithFrame:CGRectMake(0, 80.0, SCREEN_WIDTH, 100.0) andTotal:[NSNumber numberWithInt:100] andCurrent:[NSNumber numberWithInt:60] andClockwise:NO];
PNCircleChart * circleChart = [[PNCircleChart alloc] initWithFrame:CGRectMake(0, 80.0, SCREEN_WIDTH, 100.0) andTotal:[NSNumber numberWithInt:100] andCurrent:[NSNumber numberWithInt:60] andClockwise:YES andShadow:NO];
circleChart.backgroundColor = [UIColor clearColor];
[circleChart setStrokeColor:PNGreen];
[circleChart strokeChart];
PNCircleChart * circleChart2 = [[PNCircleChart alloc] initWithFrame:CGRectMake(0, 80.0, SCREEN_WIDTH, 100.0) andTotal:[NSNumber numberWithInt:100] andCurrent:[NSNumber numberWithInt:90] andClockwise:YES andShadow:YES];
circleChart2.backgroundColor = [UIColor clearColor];
[circleChart2 setStrokeColor:PNBlue];
[circleChart2 strokeChart];
[viewController.view addSubview:circleChartLabel];
[viewController.view addSubview:circleChart2];
[viewController.view addSubview:circleChart];
viewController.title = @"Circle Chart";
... ...