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

Commit 8ac5614

Browse files
committed
Fixed Issue with Color Background X-Axis and Frame
- See second part of issue #62
1 parent 5159589 commit 8ac5614

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

Classes/BEMSimpleLineGraphView.m

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,10 @@ - (void)drawLine {
416416
line.enableRefrenceLines = YES;
417417
line.arrayOfVerticalRefrenceLinePoints = xAxisLabelPoints;
418418
line.arrayOfHorizontalRefrenceLinePoints = yAxisLabelPoints;
419-
420-
line.frameOffset = self.XAxisLabelYOffset;
421419
}
422420

421+
line.frameOffset = self.XAxisLabelYOffset;
422+
423423
line.color = self.colorLine;
424424
line.animationTime = self.animationGraphEntranceTime;
425425
line.animationType = self.animationGraphStyle;
@@ -584,15 +584,20 @@ - (void)drawXAxis {
584584

585585
- (void)drawYAxis {
586586
for (UIView *subview in [self subviews]) {
587-
if ([subview isKindOfClass:[UILabel class]] && subview.tag == 2000)
587+
if ([subview isKindOfClass:[UILabel class]] && subview.tag == 2000) {
588588
[subview removeFromSuperview];
589+
}
590+
else if ([subview isKindOfClass:[UIView class] ] && subview.tag == 2100) {
591+
[subview removeFromSuperview];
592+
}
589593
}
590594

591595
UIView *backgroundYaxis = [[UIView alloc]initWithFrame:CGRectMake(0, 0, labelYaxisOffset, self.frame.size.height)];
596+
backgroundYaxis.tag = 2100;
592597
if (self.colorBackgroundYaxis == nil) {
593-
self.colorBackgroundYaxis = self.colorTop;
594-
}
595-
backgroundYaxis.backgroundColor = self.colorBackgroundYaxis;
598+
backgroundYaxis.backgroundColor = self.colorTop;
599+
} else backgroundYaxis.backgroundColor = self.colorBackgroundYaxis;
600+
596601
backgroundYaxis.alpha = self.alphaBackgroundYaxis;
597602
[self addSubview:backgroundYaxis];
598603

@@ -789,7 +794,7 @@ - (void)reloadGraph {
789794
for (UIView *subviews in self.subviews) {
790795
[subviews removeFromSuperview];
791796
}
792-
797+
793798
[self setNeedsLayout];
794799
}
795800

0 commit comments

Comments
 (0)