Kevin

Merge pull request #199 from makoni/master

- Fix for issue: https://github.com/kevinzhow/PNChart/issues/198
... ... @@ -61,6 +61,10 @@
_showChartBorder = NO;
_yChartLabelWidth = 18;
_rotateForXAxisText = false;
yLabelFormatter = ^(CGFloat yValue){
return [NSString stringWithFormat:@"%1.f",yValue];
};
}
- (void)setYValues:(NSArray *)yValues
... ... @@ -141,9 +145,10 @@
}else{
_xChartLabels = [NSMutableArray new];
}
if (_showLabel) {
_xLabelWidth = (self.frame.size.width - _chartMargin * 2) / [xLabels count];
_xLabelWidth = (self.frame.size.width - _chartMargin * 2) / [xLabels count];
if (_showLabel) {
int labelAddCount = 0;
for (int index = 0; index < _xLabels.count; index++) {
labelAddCount += 1;
... ...
... ... @@ -409,7 +409,7 @@
if (!(_yValueMax - _yValueMin)) {
innerGrade = 0.5;
} else {
innerGrade = (yValue - _yValueMin) / (_yValueMax - _yValueMin) == 0 ? 0.5 : (yValue - _yValueMin) / (_yValueMax - _yValueMin);
innerGrade = (yValue - _yValueMin) / (_yValueMax - _yValueMin);
}
CGFloat offSetX = (_chartCavanWidth) / (chartData.itemCount);
... ...