Showing
1 changed file
with
18 additions
and
4 deletions
| @@ -22,11 +22,29 @@ | @@ -22,11 +22,29 @@ | ||
| 22 | 22 | ||
| 23 | @implementation PNBarChart | 23 | @implementation PNBarChart |
| 24 | 24 | ||
| 25 | +- (id)initWithCoder:(NSCoder *)aDecoder | ||
| 26 | +{ | ||
| 27 | + self = [super initWithCoder:aDecoder]; | ||
| 28 | + | ||
| 29 | + if (self) { | ||
| 30 | + [self setupDefaultValues]; | ||
| 31 | + } | ||
| 32 | + return self; | ||
| 33 | +} | ||
| 34 | + | ||
| 25 | - (id)initWithFrame:(CGRect)frame | 35 | - (id)initWithFrame:(CGRect)frame |
| 26 | { | 36 | { |
| 27 | self = [super initWithFrame:frame]; | 37 | self = [super initWithFrame:frame]; |
| 28 | 38 | ||
| 29 | if (self) { | 39 | if (self) { |
| 40 | + [self setupDefaultValues]; | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + return self; | ||
| 44 | +} | ||
| 45 | + | ||
| 46 | +- (void)setupDefaultValues | ||
| 47 | +{ | ||
| 30 | self.backgroundColor = [UIColor whiteColor]; | 48 | self.backgroundColor = [UIColor whiteColor]; |
| 31 | self.clipsToBounds = YES; | 49 | self.clipsToBounds = YES; |
| 32 | _showLabel = YES; | 50 | _showLabel = YES; |
| @@ -44,12 +62,8 @@ | @@ -44,12 +62,8 @@ | ||
| 44 | _showChartBorder = NO; | 62 | _showChartBorder = NO; |
| 45 | _yChartLabelWidth = 18; | 63 | _yChartLabelWidth = 18; |
| 46 | _rotateForXAxisText = false; | 64 | _rotateForXAxisText = false; |
| 47 | - } | ||
| 48 | - | ||
| 49 | - return self; | ||
| 50 | } | 65 | } |
| 51 | 66 | ||
| 52 | - | ||
| 53 | - (void)setYValues:(NSArray *)yValues | 67 | - (void)setYValues:(NSArray *)yValues |
| 54 | { | 68 | { |
| 55 | _yValues = yValues; | 69 | _yValues = yValues; |
-
Please register or login to post a comment