dullgrass

Optimize

@@ -10,8 +10,6 @@ @@ -10,8 +10,6 @@
10 #import "PNColor.h" 10 #import "PNColor.h"
11 #import "PNChartLabel.h" 11 #import "PNChartLabel.h"
12 12
13 -#define defaultYSum 0 //默认的Y显示值的个数,  
14 -  
15 @interface PNBarChart () { 13 @interface PNBarChart () {
16 NSMutableArray *_xChartLabels; 14 NSMutableArray *_xChartLabels;
17 NSMutableArray *_yChartLabels; 15 NSMutableArray *_yChartLabels;
@@ -87,8 +85,8 @@ @@ -87,8 +85,8 @@
87 } else { 85 } else {
88 [self getYValueMax:yAxisValues]; 86 [self getYValueMax:yAxisValues];
89 } 87 }
90 - 88 +
91 - if (_yLabelSum==defaultYSum) { 89 + if (_yLabelSum==4) {
92 _yLabelSum = yAxisValues.count; 90 _yLabelSum = yAxisValues.count;
93 (_yLabelSum % 2 == 0) ? _yLabelSum : _yLabelSum++; 91 (_yLabelSum % 2 == 0) ? _yLabelSum : _yLabelSum++;
94 } 92 }