@@ -416,10 +416,10 @@ - (void)drawLine {
416
416
line.enableRefrenceLines = YES ;
417
417
line.arrayOfVerticalRefrenceLinePoints = xAxisLabelPoints;
418
418
line.arrayOfHorizontalRefrenceLinePoints = yAxisLabelPoints;
419
-
420
- line.frameOffset = self.XAxisLabelYOffset ;
421
419
}
422
420
421
+ line.frameOffset = self.XAxisLabelYOffset ;
422
+
423
423
line.color = self.colorLine ;
424
424
line.animationTime = self.animationGraphEntranceTime ;
425
425
line.animationType = self.animationGraphStyle ;
@@ -584,15 +584,20 @@ - (void)drawXAxis {
584
584
585
585
- (void )drawYAxis {
586
586
for (UIView *subview in [self subviews ]) {
587
- if ([subview isKindOfClass: [UILabel class ]] && subview.tag == 2000 )
587
+ if ([subview isKindOfClass: [UILabel class ]] && subview.tag == 2000 ) {
588
588
[subview removeFromSuperview ];
589
+ }
590
+ else if ([subview isKindOfClass: [UIView class ] ] && subview.tag == 2100 ) {
591
+ [subview removeFromSuperview ];
592
+ }
589
593
}
590
594
591
595
UIView *backgroundYaxis = [[UIView alloc ]initWithFrame:CGRectMake (0 , 0 , labelYaxisOffset, self .frame.size.height)];
596
+ backgroundYaxis.tag = 2100 ;
592
597
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
+
596
601
backgroundYaxis.alpha = self.alphaBackgroundYaxis ;
597
602
[self addSubview: backgroundYaxis];
598
603
@@ -789,7 +794,7 @@ - (void)reloadGraph {
789
794
for (UIView *subviews in self.subviews ) {
790
795
[subviews removeFromSuperview ];
791
796
}
792
-
797
+
793
798
[self setNeedsLayout ];
794
799
}
795
800
0 commit comments