Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Commit

Permalink
Fixed Issue with Color Background X-Axis and Frame
Browse files Browse the repository at this point in the history
- See second part of issue #62
  • Loading branch information
Boris-Em committed Aug 28, 2014
1 parent 5159589 commit 8ac5614
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions Classes/BEMSimpleLineGraphView.m
Original file line number Diff line number Diff line change
Expand Up @@ -416,10 +416,10 @@ - (void)drawLine {
line.enableRefrenceLines = YES;
line.arrayOfVerticalRefrenceLinePoints = xAxisLabelPoints;
line.arrayOfHorizontalRefrenceLinePoints = yAxisLabelPoints;

line.frameOffset = self.XAxisLabelYOffset;
}

line.frameOffset = self.XAxisLabelYOffset;

line.color = self.colorLine;
line.animationTime = self.animationGraphEntranceTime;
line.animationType = self.animationGraphStyle;
Expand Down Expand Up @@ -584,15 +584,20 @@ - (void)drawXAxis {

- (void)drawYAxis {
for (UIView *subview in [self subviews]) {
if ([subview isKindOfClass:[UILabel class]] && subview.tag == 2000)
if ([subview isKindOfClass:[UILabel class]] && subview.tag == 2000) {
[subview removeFromSuperview];
}
else if ([subview isKindOfClass:[UIView class] ] && subview.tag == 2100) {
[subview removeFromSuperview];
}
}

UIView *backgroundYaxis = [[UIView alloc]initWithFrame:CGRectMake(0, 0, labelYaxisOffset, self.frame.size.height)];
backgroundYaxis.tag = 2100;
if (self.colorBackgroundYaxis == nil) {
self.colorBackgroundYaxis = self.colorTop;
}
backgroundYaxis.backgroundColor = self.colorBackgroundYaxis;
backgroundYaxis.backgroundColor = self.colorTop;
} else backgroundYaxis.backgroundColor = self.colorBackgroundYaxis;

backgroundYaxis.alpha = self.alphaBackgroundYaxis;
[self addSubview:backgroundYaxis];

Expand Down Expand Up @@ -789,7 +794,7 @@ - (void)reloadGraph {
for (UIView *subviews in self.subviews) {
[subviews removeFromSuperview];
}

[self setNeedsLayout];
}

Expand Down
Binary file not shown.

0 comments on commit 8ac5614

Please sign in to comment.