diff --git a/Classes/BEMSimpleLineGraphView.m b/Classes/BEMSimpleLineGraphView.m index 1f51327..301b7c0 100644 --- a/Classes/BEMSimpleLineGraphView.m +++ b/Classes/BEMSimpleLineGraphView.m @@ -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; @@ -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]; @@ -789,7 +794,7 @@ - (void)reloadGraph { for (UIView *subviews in self.subviews) { [subviews removeFromSuperview]; } - + [self setNeedsLayout]; } diff --git a/Sample Project/SimpleLineChart.xcodeproj/project.xcworkspace/xcuserdata/bobo.xcuserdatad/UserInterfaceState.xcuserstate b/Sample Project/SimpleLineChart.xcodeproj/project.xcworkspace/xcuserdata/bobo.xcuserdatad/UserInterfaceState.xcuserstate index 34e1dad..6a81b54 100644 Binary files a/Sample Project/SimpleLineChart.xcodeproj/project.xcworkspace/xcuserdata/bobo.xcuserdatad/UserInterfaceState.xcuserstate and b/Sample Project/SimpleLineChart.xcodeproj/project.xcworkspace/xcuserdata/bobo.xcuserdatad/UserInterfaceState.xcuserstate differ