Fix comments.
- Make more correct in terms of English grammar and spelling and so forth. - Use commonly-used documentation comment syntax.
Showing
4 changed files
with
37 additions
and
73 deletions
| @@ -20,9 +20,8 @@ typedef NSString *(^PNyLabelFromatter)(CGFloat yLabelValue); | @@ -20,9 +20,8 @@ typedef NSString *(^PNyLabelFromatter)(CGFloat yLabelValue); | ||
| 20 | @interface PNBarChart : UIView | 20 | @interface PNBarChart : UIView |
| 21 | 21 | ||
| 22 | /** | 22 | /** |
| 23 | - * This method will call and stroke the line in animation | 23 | + * Draws the chart in an animated fashion. |
| 24 | */ | 24 | */ |
| 25 | - | ||
| 26 | - (void)strokeChart; | 25 | - (void)strokeChart; |
| 27 | 26 | ||
| 28 | @property (nonatomic) NSArray *xLabels; | 27 | @property (nonatomic) NSArray *xLabels; |
| @@ -37,98 +36,58 @@ typedef NSString *(^PNyLabelFromatter)(CGFloat yLabelValue); | @@ -37,98 +36,58 @@ typedef NSString *(^PNyLabelFromatter)(CGFloat yLabelValue); | ||
| 37 | @property (nonatomic) NSArray *strokeColors; | 36 | @property (nonatomic) NSArray *strokeColors; |
| 38 | 37 | ||
| 39 | 38 | ||
| 40 | -/* | 39 | +/** Changes chart margin. */ |
| 41 | - chartMargin changes chart margin | ||
| 42 | - */ | ||
| 43 | @property (nonatomic) CGFloat yChartLabelWidth; | 40 | @property (nonatomic) CGFloat yChartLabelWidth; |
| 44 | 41 | ||
| 45 | -/* | 42 | +/** Formats the ylabel text. */ |
| 46 | - yLabelFormatter will format the ylabel text | ||
| 47 | - */ | ||
| 48 | - | ||
| 49 | @property (copy) PNyLabelFromatter yLabelFormatter; | 43 | @property (copy) PNyLabelFromatter yLabelFormatter; |
| 50 | 44 | ||
| 51 | -/* | ||
| 52 | - chartMargin changes chart margin | ||
| 53 | - */ | ||
| 54 | @property (nonatomic) CGFloat chartMargin; | 45 | @property (nonatomic) CGFloat chartMargin; |
| 55 | 46 | ||
| 56 | -/* | 47 | +/** Controls whether labels should be displayed. */ |
| 57 | - showLabelDefines if the Labels should be deplay | ||
| 58 | - */ | ||
| 59 | @property (nonatomic) BOOL showLabel; | 48 | @property (nonatomic) BOOL showLabel; |
| 60 | 49 | ||
| 61 | -/* | 50 | +/** Controls whether the chart border line should be displayed. */ |
| 62 | - showChartBorder if the chart border Line should be deplay | ||
| 63 | - */ | ||
| 64 | @property (nonatomic) BOOL showChartBorder; | 51 | @property (nonatomic) BOOL showChartBorder; |
| 65 | 52 | ||
| 66 | -/* | 53 | +/** Chart bottom border, co-linear with the x-axis. */ |
| 67 | - chartBottomLine the Line at the chart bottom | ||
| 68 | - */ | ||
| 69 | @property (nonatomic) CAShapeLayer * chartBottomLine; | 54 | @property (nonatomic) CAShapeLayer * chartBottomLine; |
| 70 | 55 | ||
| 71 | -/* | 56 | +/** Chart left border, co-linear with the y-axis. */ |
| 72 | - chartLeftLine the Line at the chart left | ||
| 73 | - */ | ||
| 74 | @property (nonatomic) CAShapeLayer * chartLeftLine; | 57 | @property (nonatomic) CAShapeLayer * chartLeftLine; |
| 75 | 58 | ||
| 76 | -/* | 59 | +/** Corner radius for all bars in the chart. */ |
| 77 | - barRadius changes the bar corner radius | ||
| 78 | - */ | ||
| 79 | @property (nonatomic) CGFloat barRadius; | 60 | @property (nonatomic) CGFloat barRadius; |
| 80 | 61 | ||
| 81 | -/* | 62 | +/** Width of all bars in the chart. */ |
| 82 | - barWidth changes the width of the bar | ||
| 83 | - */ | ||
| 84 | @property (nonatomic) CGFloat barWidth; | 63 | @property (nonatomic) CGFloat barWidth; |
| 85 | 64 | ||
| 86 | -/* | ||
| 87 | - labelMarginTop changes the width of the bar | ||
| 88 | - */ | ||
| 89 | @property (nonatomic) CGFloat labelMarginTop; | 65 | @property (nonatomic) CGFloat labelMarginTop; |
| 90 | 66 | ||
| 91 | -/* | 67 | +/** Background color of all bars in the chart. */ |
| 92 | - barBackgroundColor changes the bar background color | ||
| 93 | - */ | ||
| 94 | @property (nonatomic) UIColor * barBackgroundColor; | 68 | @property (nonatomic) UIColor * barBackgroundColor; |
| 95 | 69 | ||
| 96 | -/* | 70 | +/** Text color for all bars in the chart. */ |
| 97 | - labelTextColor changes the bar label text color | ||
| 98 | - */ | ||
| 99 | @property (nonatomic) UIColor * labelTextColor; | 71 | @property (nonatomic) UIColor * labelTextColor; |
| 100 | 72 | ||
| 101 | -/* | 73 | +/** Font for all bars in the chart. */ |
| 102 | - labelFont changes the bar label font | ||
| 103 | - */ | ||
| 104 | @property (nonatomic) UIFont * labelFont; | 74 | @property (nonatomic) UIFont * labelFont; |
| 105 | 75 | ||
| 106 | -/* | 76 | +/** How many labels on the x-axis to skip in between displaying labels. */ |
| 107 | - xLabelSkip define the label skip number | ||
| 108 | - */ | ||
| 109 | @property (nonatomic) NSInteger xLabelSkip; | 77 | @property (nonatomic) NSInteger xLabelSkip; |
| 110 | 78 | ||
| 111 | -/* | 79 | +/** How many labels on the y-axis to skip in between displaying labels. */ |
| 112 | - yLabelSum define the label sum number | ||
| 113 | - */ | ||
| 114 | @property (nonatomic) NSInteger yLabelSum; | 80 | @property (nonatomic) NSInteger yLabelSum; |
| 115 | 81 | ||
| 116 | -/* | 82 | +/** The maximum for the range of values to display on the y-axis. */ |
| 117 | - yMaxValue define the max value of the chart | ||
| 118 | - */ | ||
| 119 | @property (nonatomic) CGFloat yMaxValue; | 83 | @property (nonatomic) CGFloat yMaxValue; |
| 120 | 84 | ||
| 121 | -/* | 85 | +/** The minimum for the range of values to display on the y-axis. */ |
| 122 | - yMinValue define the min value of the chart | ||
| 123 | - */ | ||
| 124 | @property (nonatomic) CGFloat yMinValue; | 86 | @property (nonatomic) CGFloat yMinValue; |
| 125 | 87 | ||
| 126 | -/* | 88 | +/** Controls whether each bar should have a gradient fill. */ |
| 127 | - switch to indicate that the bar should be filled as a gradient | ||
| 128 | - */ | ||
| 129 | @property (nonatomic) UIColor *barColorGradientStart; | 89 | @property (nonatomic) UIColor *barColorGradientStart; |
| 130 | 90 | ||
| 131 | - | ||
| 132 | @property (nonatomic, retain) id<PNChartDelegate> delegate; | 91 | @property (nonatomic, retain) id<PNChartDelegate> delegate; |
| 133 | 92 | ||
| 134 | @end | 93 | @end |
| @@ -11,20 +11,17 @@ | @@ -11,20 +11,17 @@ | ||
| 11 | @protocol PNChartDelegate <NSObject> | 11 | @protocol PNChartDelegate <NSObject> |
| 12 | 12 | ||
| 13 | /** | 13 | /** |
| 14 | - * When user click on the chart line | 14 | + * Callback method that gets invoked when the user taps on the chart line. |
| 15 | - * | ||
| 16 | */ | 15 | */ |
| 17 | - (void)userClickedOnLinePoint:(CGPoint)point lineIndex:(NSInteger)lineIndex; | 16 | - (void)userClickedOnLinePoint:(CGPoint)point lineIndex:(NSInteger)lineIndex; |
| 18 | 17 | ||
| 19 | /** | 18 | /** |
| 20 | - * When user click on the chart line key point | 19 | + * Callback method that gets invoked when the user taps on a chart line key point. |
| 21 | - * | ||
| 22 | */ | 20 | */ |
| 23 | - (void)userClickedOnLineKeyPoint:(CGPoint)point lineIndex:(NSInteger)lineIndex andPointIndex:(NSInteger)pointIndex; | 21 | - (void)userClickedOnLineKeyPoint:(CGPoint)point lineIndex:(NSInteger)lineIndex andPointIndex:(NSInteger)pointIndex; |
| 24 | 22 | ||
| 25 | /** | 23 | /** |
| 26 | - * When user click on a chart bar | 24 | + * Callback method that gets invoked when the user taps on a chart bar. |
| 27 | - * | ||
| 28 | */ | 25 | */ |
| 29 | - (void)userClickedOnBarCharIndex:(NSInteger)barIndex; | 26 | - (void)userClickedOnBarCharIndex:(NSInteger)barIndex; |
| 30 | 27 |
| @@ -13,9 +13,8 @@ | @@ -13,9 +13,8 @@ | ||
| 13 | @interface PNLineChart : UIView | 13 | @interface PNLineChart : UIView |
| 14 | 14 | ||
| 15 | /** | 15 | /** |
| 16 | - * This method will call and troke the line in animation | 16 | + * Draws the chart in an animated fashion. |
| 17 | */ | 17 | */ |
| 18 | - | ||
| 19 | - (void)strokeChart; | 18 | - (void)strokeChart; |
| 20 | 19 | ||
| 21 | @property (nonatomic, retain) id<PNChartDelegate> delegate; | 20 | @property (nonatomic, retain) id<PNChartDelegate> delegate; |
| @@ -58,7 +57,7 @@ | @@ -58,7 +57,7 @@ | ||
| 58 | @property (nonatomic) BOOL showLabel; | 57 | @property (nonatomic) BOOL showLabel; |
| 59 | 58 | ||
| 60 | /** | 59 | /** |
| 61 | - * show CoordinateAxis ornot, Default is not | 60 | + * Controls whether to show the coordinate axis. Default is NO. |
| 62 | */ | 61 | */ |
| 63 | @property (nonatomic, getter = isShowCoordinateAxis) BOOL showCoordinateAxis; | 62 | @property (nonatomic, getter = isShowCoordinateAxis) BOOL showCoordinateAxis; |
| 64 | @property (nonatomic) UIColor *axisColor; | 63 | @property (nonatomic) UIColor *axisColor; |
| @@ -68,7 +67,7 @@ | @@ -68,7 +67,7 @@ | ||
| 68 | @property (nonatomic, strong) NSString *yUnit; | 67 | @property (nonatomic, strong) NSString *yUnit; |
| 69 | 68 | ||
| 70 | /** | 69 | /** |
| 71 | - * String formatter for float values in y labels. If not set, defaults to @"%1.f" | 70 | + * String formatter for float values in y-axis labels. If not set, defaults to @"%1.f" |
| 72 | */ | 71 | */ |
| 73 | @property (nonatomic, strong) NSString *yLabelFormat; | 72 | @property (nonatomic, strong) NSString *yLabelFormat; |
| 74 | 73 |
| @@ -15,11 +15,20 @@ | @@ -15,11 +15,20 @@ | ||
| 15 | 15 | ||
| 16 | @property (nonatomic, readonly) NSArray *items; | 16 | @property (nonatomic, readonly) NSArray *items; |
| 17 | 17 | ||
| 18 | -@property (nonatomic) UIFont *descriptionTextFont; //default is [UIFont fontWithName:@"Avenir-Medium" size:18.0]; | 18 | +/** Default is 18-point Avenir-Medium. */ |
| 19 | -@property (nonatomic) UIColor *descriptionTextColor; //default is [UIColor whiteColor] | 19 | +@property (nonatomic) UIFont *descriptionTextFont; |
| 20 | -@property (nonatomic) UIColor *descriptionTextShadowColor; //default is [[UIColor blackColor] colorWithAlphaComponent:0.4] | 20 | + |
| 21 | -@property (nonatomic) CGSize descriptionTextShadowOffset; //default is CGSizeMake(0, 1) | 21 | +/** Default is white. */ |
| 22 | -@property (nonatomic) NSTimeInterval duration;//default is 1.0 | 22 | +@property (nonatomic) UIColor *descriptionTextColor; |
| 23 | + | ||
| 24 | +/** Default is black, with an alpha of 0.4. */ | ||
| 25 | +@property (nonatomic) UIColor *descriptionTextShadowColor; | ||
| 26 | + | ||
| 27 | +/** Default is CGSizeMake(0, 1). */ | ||
| 28 | +@property (nonatomic) CGSize descriptionTextShadowOffset; | ||
| 29 | + | ||
| 30 | +/** Default is 1.0. */ | ||
| 31 | +@property (nonatomic) NSTimeInterval duration; | ||
| 23 | 32 | ||
| 24 | - (void)strokeChart; | 33 | - (void)strokeChart; |
| 25 | 34 |
-
Please register or login to post a comment