kevinzhow

Fix Bar chart x label position

@@ -123,14 +123,8 @@ @@ -123,14 +123,8 @@
123 label.textColor = _labelTextColor; 123 label.textColor = _labelTextColor;
124 [label setTextAlignment:NSTextAlignmentCenter]; 124 [label setTextAlignment:NSTextAlignmentCenter];
125 label.text = labelText; 125 label.text = labelText;
126 - NSLog(@"Label text is %@",labelText);  
127 [label sizeToFit]; 126 [label sizeToFit];
128 - CGFloat labelXPosition; 127 + CGFloat labelXPosition = (index * _xLabelWidth + _chartMargin + _xLabelWidth /2.0 );
129 - if (label.frame.size.width < _xLabelWidth) {  
130 - labelXPosition = (index * _xLabelWidth + _chartMargin + _xLabelWidth /2.0 );  
131 - }else{  
132 - labelXPosition = (index * _xLabelWidth + _chartMargin + label.frame.size.width /2.0 );  
133 - }  
134 128
135 label.center = CGPointMake(labelXPosition, 129 label.center = CGPointMake(labelXPosition,
136 self.frame.size.height - xLabelHeight - _chartMargin + label.frame.size.height /2.0 + _labelMarginTop); 130 self.frame.size.height - xLabelHeight - _chartMargin + label.frame.size.height /2.0 + _labelMarginTop);