Skip to content

Commit c930f6a

Browse files
committed
Fix Bar chart x label position
1 parent 1823eec commit c930f6a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

PNChart/PNBarChart/PNBarChart.m

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,8 @@ - (void)strokeChart
123123
label.textColor = _labelTextColor;
124124
[label setTextAlignment:NSTextAlignmentCenter];
125125
label.text = labelText;
126-
NSLog(@"Label text is %@",labelText);
127126
[label sizeToFit];
128-
CGFloat labelXPosition;
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-
}
127+
CGFloat labelXPosition = (index * _xLabelWidth + _chartMargin + _xLabelWidth /2.0 );
134128

135129
label.center = CGPointMake(labelXPosition,
136130
self.frame.size.height - xLabelHeight - _chartMargin + label.frame.size.height /2.0 + _labelMarginTop);

0 commit comments

Comments
 (0)