onevcat

Add initWithCoder for bar chart

... ... @@ -22,11 +22,29 @@
@implementation PNBarChart
- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super initWithCoder:aDecoder];
if (self) {
[self setupDefaultValues];
}
return self;
}
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self setupDefaultValues];
}
return self;
}
- (void)setupDefaultValues
{
self.backgroundColor = [UIColor whiteColor];
self.clipsToBounds = YES;
_showLabel = YES;
... ... @@ -44,12 +62,8 @@
_showChartBorder = NO;
_yChartLabelWidth = 18;
_rotateForXAxisText = false;
}
return self;
}
- (void)setYValues:(NSArray *)yValues
{
_yValues = yValues;
... ...