Skip to content

Commit

Permalink
removing the suffix from 0 value on y-axis
Browse files Browse the repository at this point in the history
  • Loading branch information
grevolution committed Mar 17, 2014
1 parent fcbea1f commit 3ce6c9d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion SHLineGraphView/SHLineGraphView/SHLineGraphView.m
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,12 @@ - (void)drawYLabels {
yAxisLabel.font = FONT_WITH_SIZE(10);
yAxisLabel.textColor = [UIColor colorWithRed:0.48 green:0.48 blue:0.49 alpha:0.4];
yAxisLabel.textAlignment = NSTextAlignmentCenter;
yAxisLabel.text = [NSString stringWithFormat:@"%.1f%@", (yIntervalValue * (10 - i)), _yAxisSuffix];
float val = (yIntervalValue * (10 - i));
if(val > 0){
yAxisLabel.text = [NSString stringWithFormat:@"%.1f%@", val, _yAxisSuffix];
} else {
yAxisLabel.text = [NSString stringWithFormat:@"%.0f", val];
}
[self addSubview:yAxisLabel];
}
}
Expand Down

0 comments on commit 3ce6c9d

Please sign in to comment.