mobileflowllc

Updated circle chart API

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