Kevin

Merge pull request #50 from moflo/master

Updated circle chart API
@@ -3,7 +3,7 @@ Pod::Spec.new do |s| @@ -3,7 +3,7 @@ Pod::Spec.new do |s|
3 s.version = "0.2.2" 3 s.version = "0.2.2"
4 s.summary = "A simple and beautiful chart lib with animation used in Piner for iOS" 4 s.summary = "A simple and beautiful chart lib with animation used in Piner for iOS"
5 5
6 - s.homepage = "https://github.com/kevinzhow/PNChart" 6 + s.homepage = "https://github.com/moflo/PNChart"
7 s.screenshots = "https://github-camo.global.ssl.fastly.net/ea8565b7a726409d5966ff4bcb8c4b9981fb33d3/687474703a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f313539393636322f706e63686172742e706e67" 7 s.screenshots = "https://github-camo.global.ssl.fastly.net/ea8565b7a726409d5966ff4bcb8c4b9981fb33d3/687474703a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f313539393636322f706e63686172742e706e67"
8 8
9 s.license = { :type => 'MIT', :file => 'LICENSE' } 9 s.license = { :type => 'MIT', :file => 'LICENSE' }
@@ -11,12 +11,12 @@ Pod::Spec.new do |s| @@ -11,12 +11,12 @@ Pod::Spec.new do |s|
11 s.author = { "Kevin" => "kevinchou.c@gmail.com" } 11 s.author = { "Kevin" => "kevinchou.c@gmail.com" }
12 12
13 s.platform = :ios, '6.0' 13 s.platform = :ios, '6.0'
14 - s.source = { :git => "https://github.com/kevinzhow/PNChart.git", :tag => s.version.to_s } 14 + s.source = { :git => "https://github.com/moflo/PNChart.git" }
15 15
16 s.ios.dependency 'UICountingLabel', '~> 1.0.0' 16 s.ios.dependency 'UICountingLabel', '~> 1.0.0'
17 17
18 - s.source_files = 'PNChartDemo/PNChart/**/*.{h,m}' 18 + s.source_files = 'PNChart/*.{h,m}'
19 - s.public_header_files = 'PNChartDemo/PNChart/**/*.h' 19 + s.public_header_files = 'PNChart/*.h'
20 s.frameworks = 'CoreGraphics', 'UIKit', 'Foundation', 'QuartzCore' 20 s.frameworks = 'CoreGraphics', 'UIKit', 'Foundation', 'QuartzCore'
21 s.requires_arc = true 21 s.requires_arc = true
22 end 22 end
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 @interface PNCircleChart : UIView 15 @interface PNCircleChart : UIView
16 16
17 - (void)strokeChart; 17 - (void)strokeChart;
18 -- (id)initWithFrame:(CGRect)frame andTotal:(NSNumber *)total andCurrent:(NSNumber *)current andClockwise:(BOOL)clockwise; 18 +- (id)initWithFrame:(CGRect)frame andTotal:(NSNumber *)total andCurrent:(NSNumber *)current andClockwise:(BOOL)clockwise andShadow:(BOOL)hasBackgroundShadow;
19 19
20 @property (nonatomic) UIColor *strokeColor; 20 @property (nonatomic) UIColor *strokeColor;
21 @property (nonatomic) UIColor *labelColor; 21 @property (nonatomic) UIColor *labelColor;
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 } 27 }
28 28
29 29
30 -- (id)initWithFrame:(CGRect)frame andTotal:(NSNumber *)total andCurrent:(NSNumber *)current andClockwise:(BOOL)clockwise 30 +- (id)initWithFrame:(CGRect)frame andTotal:(NSNumber *)total andCurrent:(NSNumber *)current andClockwise:(BOOL)clockwise andShadow:(BOOL)hasBackgroundShadow
31 { 31 {
32 self = [super initWithFrame:frame]; 32 self = [super initWithFrame:frame];
33 33
@@ -55,7 +55,7 @@ @@ -55,7 +55,7 @@
55 _circleBG.lineCap = kCALineCapRound; 55 _circleBG.lineCap = kCALineCapRound;
56 _circleBG.fillColor = [UIColor clearColor].CGColor; 56 _circleBG.fillColor = [UIColor clearColor].CGColor;
57 _circleBG.lineWidth = [_lineWidth floatValue]; 57 _circleBG.lineWidth = [_lineWidth floatValue];
58 - _circleBG.strokeColor = PNLightYellow.CGColor; 58 + _circleBG.strokeColor = (hasBackgroundShadow ? PNLightYellow.CGColor : [UIColor clearColor].CGColor);
59 _circleBG.strokeEnd = 1.0; 59 _circleBG.strokeEnd = 1.0;
60 _circleBG.zPosition = -1; 60 _circleBG.zPosition = -1;
61 61
@@ -129,12 +129,18 @@ @@ -129,12 +129,18 @@
129 circleChartLabel.font = [UIFont fontWithName:@"Avenir-Medium" size:23.0]; 129 circleChartLabel.font = [UIFont fontWithName:@"Avenir-Medium" size:23.0];
130 circleChartLabel.textAlignment = NSTextAlignmentCenter; 130 circleChartLabel.textAlignment = NSTextAlignmentCenter;
131 131
132 - PNCircleChart * circleChart = [[PNCircleChart alloc] initWithFrame:CGRectMake(0, 80.0, SCREEN_WIDTH, 100.0) andTotal:[NSNumber numberWithInt:100] andCurrent:[NSNumber numberWithInt:60] andClockwise:NO]; 132 + 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];
133 circleChart.backgroundColor = [UIColor clearColor]; 133 circleChart.backgroundColor = [UIColor clearColor];
134 [circleChart setStrokeColor:PNGreen]; 134 [circleChart setStrokeColor:PNGreen];
135 [circleChart strokeChart]; 135 [circleChart strokeChart];
136 136
  137 + 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];
  138 + circleChart2.backgroundColor = [UIColor clearColor];
  139 + [circleChart2 setStrokeColor:PNBlue];
  140 + [circleChart2 strokeChart];
  141 +
137 [viewController.view addSubview:circleChartLabel]; 142 [viewController.view addSubview:circleChartLabel];
  143 + [viewController.view addSubview:circleChart2];
138 [viewController.view addSubview:circleChart]; 144 [viewController.view addSubview:circleChart];
139 viewController.title = @"Circle Chart"; 145 viewController.title = @"Circle Chart";
140 146