David Bleicher

Merge branch 'master' into CircleUpdateBug1

@@ -16,7 +16,7 @@ Pod::Spec.new do |s| @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
16 # 16 #
17 17
18 s.name = "PNChart" 18 s.name = "PNChart"
19 - s.version = "0.8.3" 19 + s.version = "0.8.5"
20 s.summary = "A simple and beautiful chart lib with animation used in Piner for iOS" 20 s.summary = "A simple and beautiful chart lib with animation used in Piner for iOS"
21 21
22 s.description = <<-DESC 22 s.description = <<-DESC
@@ -90,7 +90,7 @@ Pod::Spec.new do |s| @@ -90,7 +90,7 @@ Pod::Spec.new do |s|
90 # Supports git, hg, bzr, svn and HTTP. 90 # Supports git, hg, bzr, svn and HTTP.
91 # 91 #
92 92
93 - s.source = { :git => "https://github.com/kevinzhow/PNChart.git", :tag => "0.8.3" } 93 + s.source = { :git => "https://github.com/kevinzhow/PNChart.git", :tag => "0.8.5" }
94 94
95 95
96 # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 96 # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
@@ -76,15 +76,12 @@ @@ -76,15 +76,12 @@
76 76
77 if (_showLabel) { 77 if (_showLabel) {
78 [self __addYCoordinateLabelsValues]; 78 [self __addYCoordinateLabelsValues];
  79 + } else {
  80 + [self processYMaxValue];
79 } 81 }
80 } 82 }
81 83
82 -#pragma mark - Private Method 84 +- (void)processYMaxValue {
83 -#pragma mark - 添加柱状图的Y轴坐标  
84 -- (void)__addYCoordinateLabelsValues{  
85 -  
86 - [self viewCleanupForCollection:_yChartLabels];  
87 -  
88 NSArray *yAxisValues = _yLabels ? _yLabels : _yValues; 85 NSArray *yAxisValues = _yLabels ? _yLabels : _yValues;
89 _yLabelSum = _yLabels ? _yLabels.count - 1 :_yLabelSum; 86 _yLabelSum = _yLabels ? _yLabels.count - 1 :_yLabelSum;
90 if (_yMaxValue) { 87 if (_yMaxValue) {
@@ -97,6 +94,15 @@ @@ -97,6 +94,15 @@
97 _yLabelSum = yAxisValues.count; 94 _yLabelSum = yAxisValues.count;
98 (_yLabelSum % 2 == 0) ? _yLabelSum : _yLabelSum++; 95 (_yLabelSum % 2 == 0) ? _yLabelSum : _yLabelSum++;
99 } 96 }
  97 +}
  98 +
  99 +#pragma mark - Private Method
  100 +#pragma mark - 添加柱状图的Y轴坐标
  101 +- (void)__addYCoordinateLabelsValues{
  102 +
  103 + [self viewCleanupForCollection:_yChartLabels];
  104 +
  105 + [self processYMaxValue];
100 106
101 float sectionHeight = (self.frame.size.height - _chartMargin * 2 - kXLabelHeight) / _yLabelSum; 107 float sectionHeight = (self.frame.size.height - _chartMargin * 2 - kXLabelHeight) / _yLabelSum;
102 for (int i = 0; i <= _yLabelSum; i++) { 108 for (int i = 0; i <= _yLabelSum; i++) {
@@ -1026,7 +1026,7 @@ @@ -1026,7 +1026,7 @@
1026 [self.layer addSublayer:textLayer]; 1026 [self.layer addSublayer:textLayer];
1027 [textLayer setFontSize:textheigt/2]; 1027 [textLayer setFontSize:textheigt/2];
1028 1028
1029 - [textLayer setString:[[NSString alloc]initWithFormat:@"%ld",(NSInteger)(grade*100)]]; 1029 + [textLayer setString:[[NSString alloc]initWithFormat:@"%d",(int)(grade*100)]];
1030 [textLayer setFrame:CGRectMake(0, 0, textWidth, textheigt)]; 1030 [textLayer setFrame:CGRectMake(0, 0, textWidth, textheigt)];
1031 [textLayer setPosition:CGPointMake(pointCenter.x, textStartPosY)]; 1031 [textLayer setPosition:CGPointMake(pointCenter.x, textStartPosY)];
1032 textLayer.contentsScale = [UIScreen mainScreen].scale; 1032 textLayer.contentsScale = [UIScreen mainScreen].scale;
@@ -94,6 +94,7 @@ @@ -94,6 +94,7 @@
94 self.titleLabel.text = @"Bar Chart"; 94 self.titleLabel.text = @"Bar Chart";
95 95
96 self.barChart = [[PNBarChart alloc] initWithFrame:CGRectMake(0, 135.0, SCREEN_WIDTH, 200.0)]; 96 self.barChart = [[PNBarChart alloc] initWithFrame:CGRectMake(0, 135.0, SCREEN_WIDTH, 200.0)];
  97 +// self.barChart.showLabel = NO;
97 self.barChart.backgroundColor = [UIColor clearColor]; 98 self.barChart.backgroundColor = [UIColor clearColor];
98 self.barChart.yLabelFormatter = ^(CGFloat yValue){ 99 self.barChart.yLabelFormatter = ^(CGFloat yValue){
99 CGFloat yValueParsed = yValue; 100 CGFloat yValueParsed = yValue;
@@ -108,6 +109,7 @@ @@ -108,6 +109,7 @@
108 [self.barChart setStrokeColors:@[PNGreen,PNGreen,PNRed,PNGreen,PNGreen,PNGreen,PNRed,PNGreen]]; 109 [self.barChart setStrokeColors:@[PNGreen,PNGreen,PNRed,PNGreen,PNGreen,PNGreen,PNRed,PNGreen]];
109 self.barChart.isGradientShow = NO; 110 self.barChart.isGradientShow = NO;
110 self.barChart.isShowNumbers = NO; 111 self.barChart.isShowNumbers = NO;
  112 +
111 [self.barChart strokeChart]; 113 [self.barChart strokeChart];
112 114
113 self.barChart.delegate = self; 115 self.barChart.delegate = self;