Skip to content

Commit

Permalink
Merge pull request #56 from webventil/webventil-modulo
Browse files Browse the repository at this point in the history
Added possibility to set the axisLabelModulus manually.
  • Loading branch information
danielgindi committed Apr 30, 2015
2 parents aa6602d + 7068ba0 commit 6418a3c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Charts/Classes/Charts/BarLineChartViewBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,10 @@ public class BarLineChartViewBase: ChartViewBase, UIGestureRecognizerDelegate
return;
}

_xAxis.axisLabelModulus = Int(ceil((CGFloat(_data.xValCount) * _xAxis.labelWidth) / (_viewPortHandler.contentWidth * _viewPortHandler.touchMatrix.a)));
if (_xAxis.axisLabelModulus == 1)
{
_xAxis.axisLabelModulus = Int(ceil((CGFloat(_data.xValCount) * _xAxis.labelWidth) / (_viewPortHandler.contentWidth * _viewPortHandler.touchMatrix.a)));
}

if (_xAxis.axisLabelModulus < 1)
{
Expand Down Expand Up @@ -1363,4 +1366,4 @@ internal class BarLineChartFillFormatter: NSObject, ChartFillFormatter

return fillMin;
}
}
}

0 comments on commit 6418a3c

Please sign in to comment.