Skip to content

Commit

Permalink
fixed issue #1 and #2
Browse files Browse the repository at this point in the history
  • Loading branch information
grevolution committed Mar 28, 2014
1 parent b52c0e8 commit 7dde8d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SHLineGraphView/SHLineGraphView/SHLineGraphView.m
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ - (void)drawPlot:(SHPlot *)plot {

//x value
double height = self.bounds.size.height - BOTTOM_MARGIN_TO_LEAVE;
double y = height - ((height / ([_yAxisRange intValue] + yIntervalValue)) * [_value doubleValue]);
double y = height - ((height / ([_yAxisRange doubleValue] + yIntervalValue)) * [_value doubleValue]);
(plot.xPoints[xIndex]).x = ceil((plot.xPoints[xIndex]).x);
(plot.xPoints[xIndex]).y = ceil(y);
}];
Expand Down Expand Up @@ -328,7 +328,7 @@ - (void)drawLines:(SHPlot *)plot {
CGMutablePathRef linesPath = CGPathCreateMutable();

double intervalInPx = (self.bounds.size.height - BOTTOM_MARGIN_TO_LEAVE) / (INTERVAL_COUNT + 1);
for(int i= INTERVAL_COUNT + 1; i >=0; i--){
for(int i= INTERVAL_COUNT + 1; i > 0; i--){

CGPoint currentLinePoint = CGPointMake(_leftMarginToLeave, (i * intervalInPx));

Expand Down

0 comments on commit 7dde8d0

Please sign in to comment.