Remove some superfluous comments.
Also, remove a few lines of crufty code.
Showing
6 changed files
with
3 additions
and
27 deletions
| @@ -16,7 +16,6 @@ | @@ -16,7 +16,6 @@ | ||
| 16 | self = [super initWithFrame:frame]; | 16 | self = [super initWithFrame:frame]; |
| 17 | 17 | ||
| 18 | if (self) { | 18 | if (self) { |
| 19 | - // Initialization code | ||
| 20 | _chartLine = [CAShapeLayer layer]; | 19 | _chartLine = [CAShapeLayer layer]; |
| 21 | _chartLine.lineCap = kCALineCapButt; | 20 | _chartLine.lineCap = kCALineCapButt; |
| 22 | _chartLine.fillColor = [[UIColor whiteColor] CGColor]; | 21 | _chartLine.fillColor = [[UIColor whiteColor] CGColor]; |
| @@ -72,7 +71,6 @@ | @@ -72,7 +71,6 @@ | ||
| 72 | CAShapeLayer *gradientMask = [CAShapeLayer layer]; | 71 | CAShapeLayer *gradientMask = [CAShapeLayer layer]; |
| 73 | gradientMask.fillColor = [[UIColor clearColor] CGColor]; | 72 | gradientMask.fillColor = [[UIColor clearColor] CGColor]; |
| 74 | gradientMask.strokeColor = [[UIColor blackColor] CGColor]; | 73 | gradientMask.strokeColor = [[UIColor blackColor] CGColor]; |
| 75 | - //gradientMask.lineWidth = 4; | ||
| 76 | gradientMask.lineWidth = self.frame.size.width; | 74 | gradientMask.lineWidth = self.frame.size.width; |
| 77 | gradientMask.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height); | 75 | gradientMask.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height); |
| 78 | gradientMask.path = progressline.CGPath; | 76 | gradientMask.path = progressline.CGPath; |
| @@ -123,7 +121,6 @@ | @@ -123,7 +121,6 @@ | ||
| 123 | // An empty implementation adversely affects performance during animation. | 121 | // An empty implementation adversely affects performance during animation. |
| 124 | - (void)drawRect:(CGRect)rect | 122 | - (void)drawRect:(CGRect)rect |
| 125 | { | 123 | { |
| 126 | - //Draw BG | ||
| 127 | CGContextRef context = UIGraphicsGetCurrentContext(); | 124 | CGContextRef context = UIGraphicsGetCurrentContext(); |
| 128 | 125 | ||
| 129 | CGContextSetFillColorWithColor(context, self.backgroundColor.CGColor); | 126 | CGContextSetFillColorWithColor(context, self.backgroundColor.CGColor); |
| @@ -26,7 +26,6 @@ | @@ -26,7 +26,6 @@ | ||
| 26 | self = [super initWithFrame:frame]; | 26 | self = [super initWithFrame:frame]; |
| 27 | 27 | ||
| 28 | if (self) { | 28 | if (self) { |
| 29 | - // Initialization code | ||
| 30 | self.backgroundColor = [UIColor whiteColor]; | 29 | self.backgroundColor = [UIColor whiteColor]; |
| 31 | self.clipsToBounds = YES; | 30 | self.clipsToBounds = YES; |
| 32 | _showLabel = YES; | 31 | _showLabel = YES; |
| @@ -16,9 +16,7 @@ | @@ -16,9 +16,7 @@ | ||
| 16 | 16 | ||
| 17 | UIGraphicsBeginImageContext(rect.size); | 17 | UIGraphicsBeginImageContext(rect.size); |
| 18 | CGContextRef context = UIGraphicsGetCurrentContext(); | 18 | CGContextRef context = UIGraphicsGetCurrentContext(); |
| 19 | - CGContextSetFillColorWithColor(context, | 19 | + CGContextSetFillColorWithColor(context, [color CGColor]); |
| 20 | - [color CGColor]); | ||
| 21 | - // [[UIColor colorWithRed:222./255 green:227./255 blue: 229./255 alpha:1] CGColor]) ; | ||
| 22 | CGContextFillRect(context, rect); | 20 | CGContextFillRect(context, rect); |
| 23 | UIImage *img = UIGraphicsGetImageFromCurrentImageContext(); | 21 | UIImage *img = UIGraphicsGetImageFromCurrentImageContext(); |
| 24 | UIGraphicsEndImageContext(); | 22 | UIGraphicsEndImageContext(); |
| @@ -12,9 +12,6 @@ | @@ -12,9 +12,6 @@ | ||
| 12 | #import "PNLineChartData.h" | 12 | #import "PNLineChartData.h" |
| 13 | #import "PNLineChartDataItem.h" | 13 | #import "PNLineChartDataItem.h" |
| 14 | 14 | ||
| 15 | -// ------------------------------------------------------------------------------------------------ | ||
| 16 | -// private interface declaration | ||
| 17 | -// ------------------------------------------------------------------------------------------------ | ||
| 18 | @interface PNLineChart () | 15 | @interface PNLineChart () |
| 19 | 16 | ||
| 20 | @property (nonatomic) NSMutableArray *chartLineArray; // Array[CAShapeLayer] | 17 | @property (nonatomic) NSMutableArray *chartLineArray; // Array[CAShapeLayer] |
| @@ -27,9 +24,6 @@ | @@ -27,9 +24,6 @@ | ||
| 27 | 24 | ||
| 28 | @end | 25 | @end |
| 29 | 26 | ||
| 30 | -// ------------------------------------------------------------------------------------------------ | ||
| 31 | -// public interface implementation | ||
| 32 | -// ------------------------------------------------------------------------------------------------ | ||
| 33 | @implementation PNLineChart | 27 | @implementation PNLineChart |
| 34 | 28 | ||
| 35 | #pragma mark initialization | 29 | #pragma mark initialization |
| @@ -379,9 +373,6 @@ | @@ -379,9 +373,6 @@ | ||
| 379 | [pointLayer addAnimation:pathAnimation forKey:@"strokeEndAnimation"]; | 373 | [pointLayer addAnimation:pathAnimation forKey:@"strokeEndAnimation"]; |
| 380 | } | 374 | } |
| 381 | 375 | ||
| 382 | - [CATransaction setCompletionBlock:^{ | ||
| 383 | - // pointLayer.strokeEnd = 1.0f; // stroken point when animation end | ||
| 384 | - }]; | ||
| 385 | [CATransaction commit]; | 376 | [CATransaction commit]; |
| 386 | 377 | ||
| 387 | UIGraphicsEndImageContext(); | 378 | UIGraphicsEndImageContext(); |
| @@ -5,21 +5,14 @@ | @@ -5,21 +5,14 @@ | ||
| 5 | 5 | ||
| 6 | #import "PNLineChartDataItem.h" | 6 | #import "PNLineChartDataItem.h" |
| 7 | 7 | ||
| 8 | - | ||
| 9 | -//------------------------------------------------------------------------------------------------ | ||
| 10 | -// private interface declaration | ||
| 11 | -//------------------------------------------------------------------------------------------------ | ||
| 12 | @interface PNLineChartDataItem () | 8 | @interface PNLineChartDataItem () |
| 9 | + | ||
| 13 | - (id)initWithY:(CGFloat)y; | 10 | - (id)initWithY:(CGFloat)y; |
| 14 | 11 | ||
| 15 | @property (readwrite) CGFloat y; // should be within the y range | 12 | @property (readwrite) CGFloat y; // should be within the y range |
| 16 | -@end | ||
| 17 | - | ||
| 18 | 13 | ||
| 14 | +@end | ||
| 19 | 15 | ||
| 20 | -//------------------------------------------------------------------------------------------------ | ||
| 21 | -// public interface implementation | ||
| 22 | -//------------------------------------------------------------------------------------------------ | ||
| 23 | @implementation PNLineChartDataItem | 16 | @implementation PNLineChartDataItem |
| 24 | 17 | ||
| 25 | + (PNLineChartDataItem *)dataItemWithY:(CGFloat)y | 18 | + (PNLineChartDataItem *)dataItemWithY:(CGFloat)y |
| @@ -27,7 +20,6 @@ | @@ -27,7 +20,6 @@ | ||
| 27 | return [[PNLineChartDataItem alloc] initWithY:y]; | 20 | return [[PNLineChartDataItem alloc] initWithY:y]; |
| 28 | } | 21 | } |
| 29 | 22 | ||
| 30 | - | ||
| 31 | - (id)initWithY:(CGFloat)y | 23 | - (id)initWithY:(CGFloat)y |
| 32 | { | 24 | { |
| 33 | if ((self = [super init])) { | 25 | if ((self = [super init])) { |
| @@ -37,5 +29,4 @@ | @@ -37,5 +29,4 @@ | ||
| 37 | return self; | 29 | return self; |
| 38 | } | 30 | } |
| 39 | 31 | ||
| 40 | - | ||
| 41 | @end | 32 | @end |
-
Please register or login to post a comment