Showing
3 changed files
with
11 additions
and
11 deletions
| @@ -26,8 +26,7 @@ typedef NS_ENUM (NSUInteger, PNChartFormatType) { | @@ -26,8 +26,7 @@ typedef NS_ENUM (NSUInteger, PNChartFormatType) { | ||
| 26 | - (id)initWithFrame:(CGRect)frame | 26 | - (id)initWithFrame:(CGRect)frame |
| 27 | total:(NSNumber *)total | 27 | total:(NSNumber *)total |
| 28 | current:(NSNumber *)current | 28 | current:(NSNumber *)current |
| 29 | - clockwise:(BOOL)clockwise | 29 | + clockwise:(BOOL)clockwise; |
| 30 | - shadow:(BOOL)hasBackgroundShadow; | ||
| 31 | 30 | ||
| 32 | - (id)initWithFrame:(CGRect)frame | 31 | - (id)initWithFrame:(CGRect)frame |
| 33 | total:(NSNumber *)total | 32 | total:(NSNumber *)total |
| @@ -13,14 +13,14 @@ | @@ -13,14 +13,14 @@ | ||
| 13 | 13 | ||
| 14 | @implementation PNCircleChart | 14 | @implementation PNCircleChart |
| 15 | 15 | ||
| 16 | -- (id)initWithFrame:(CGRect)frame total:(NSNumber *)total current:(NSNumber *)current clockwise:(BOOL)clockwise shadow:(BOOL)hasBackgroundShadow { | 16 | +- (id)initWithFrame:(CGRect)frame total:(NSNumber *)total current:(NSNumber *)current clockwise:(BOOL)clockwise { |
| 17 | 17 | ||
| 18 | return [self initWithFrame:frame | 18 | return [self initWithFrame:frame |
| 19 | total:total | 19 | total:total |
| 20 | current:current | 20 | current:current |
| 21 | clockwise:clockwise | 21 | clockwise:clockwise |
| 22 | - shadow:shadow | 22 | + shadow:NO |
| 23 | - shadowColor:PNGreen | 23 | + shadowColor:[UIColor clearColor] |
| 24 | displayCountingLabel:YES | 24 | displayCountingLabel:YES |
| 25 | overrideLineWidth:@8.0f]; | 25 | overrideLineWidth:@8.0f]; |
| 26 | 26 | ||
| @@ -77,7 +77,7 @@ displayCountingLabel:(BOOL)displayCountingLabel | @@ -77,7 +77,7 @@ displayCountingLabel:(BOOL)displayCountingLabel | ||
| 77 | 77 | ||
| 78 | _lineWidth = overrideLineWidth; | 78 | _lineWidth = overrideLineWidth; |
| 79 | 79 | ||
| 80 | - UIBezierPath *circlePath = [UIBezierPath bezierPathWithArcCenter:CGPointMake(self.bounds.size.width/2.0f, self.bounds.size.height/2.0f) | 80 | + UIBezierPath *circlePath = [UIBezierPath bezierPathWithArcCenter:CGPointMake(self.frame.size.width/2.0f, self.frame.size.height/2.0f) |
| 81 | radius:(self.frame.size.height * 0.5) - ([_lineWidth floatValue]/2.0f) | 81 | radius:(self.frame.size.height * 0.5) - ([_lineWidth floatValue]/2.0f) |
| 82 | startAngle:DEGREES_TO_RADIANS(startAngle) | 82 | startAngle:DEGREES_TO_RADIANS(startAngle) |
| 83 | endAngle:DEGREES_TO_RADIANS(endAngle) | 83 | endAngle:DEGREES_TO_RADIANS(endAngle) |
| @@ -107,7 +107,7 @@ displayCountingLabel:(BOOL)displayCountingLabel | @@ -107,7 +107,7 @@ displayCountingLabel:(BOOL)displayCountingLabel | ||
| 107 | [_countingLabel setFont:[UIFont boldSystemFontOfSize:16.0f]]; | 107 | [_countingLabel setFont:[UIFont boldSystemFontOfSize:16.0f]]; |
| 108 | [_countingLabel setTextColor:[UIColor grayColor]]; | 108 | [_countingLabel setTextColor:[UIColor grayColor]]; |
| 109 | [_countingLabel setBackgroundColor:[UIColor clearColor]]; | 109 | [_countingLabel setBackgroundColor:[UIColor clearColor]]; |
| 110 | - [_countingLabel setCenter:CGPointMake(self.center.x, self.center.y)]; | 110 | + [_countingLabel setCenter:CGPointMake(self.frame.size.width/2.0f, self.frame.size.height/2.0f)]; |
| 111 | _countingLabel.method = UILabelCountingMethodEaseInOut; | 111 | _countingLabel.method = UILabelCountingMethodEaseInOut; |
| 112 | if (_displayCountingLabel) { | 112 | if (_displayCountingLabel) { |
| 113 | [self addSubview:_countingLabel]; | 113 | [self addSubview:_countingLabel]; |
| @@ -92,13 +92,14 @@ | @@ -92,13 +92,14 @@ | ||
| 92 | self.titleLabel.text = @"Circle Chart"; | 92 | self.titleLabel.text = @"Circle Chart"; |
| 93 | 93 | ||
| 94 | 94 | ||
| 95 | - self.circleChart = [[PNCircleChart alloc] initWithFrame:CGRectMake(0, 80.0, SCREEN_WIDTH, 100.0) | 95 | + self.circleChart = [[PNCircleChart alloc] initWithFrame:CGRectMake(0,150.0, SCREEN_WIDTH, 100.0) |
| 96 | total:@100 | 96 | total:@100 |
| 97 | current:@60 | 97 | current:@60 |
| 98 | - clockwise:YES | 98 | + clockwise:YES]; |
| 99 | - shadow:YES]; | 99 | + |
| 100 | self.circleChart.backgroundColor = [UIColor clearColor]; | 100 | self.circleChart.backgroundColor = [UIColor clearColor]; |
| 101 | - [self.circleChart setStrokeColor:PNGreen]; | 101 | + |
| 102 | + [self.circleChart setStrokeColor:[UIColor clearColor]]; | ||
| 102 | [self.circleChart setStrokeColorGradientStart:[UIColor blueColor]]; | 103 | [self.circleChart setStrokeColorGradientStart:[UIColor blueColor]]; |
| 103 | [self.circleChart strokeChart]; | 104 | [self.circleChart strokeChart]; |
| 104 | 105 |
-
Please register or login to post a comment