Skip to content

Commit

Permalink
Merge pull request #93 from mkubenka/objc-setlablestoskip
Browse files Browse the repository at this point in the history
Allow access to setLabelsToSkip from Objective-C.
  • Loading branch information
danielgindi committed May 19, 2015
2 parents 4ce8517 + 8d02895 commit 1b3daa1
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Charts/Classes/Components/ChartXAxis.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,18 @@ public class ChartXAxis: ChartAxisBase
/// Sets the number of labels that should be skipped on the axis before the next label is drawn.
/// This will disable the feature that automatically calculates an adequate space between the axis labels and set the number of labels to be skipped to the fixed number provided by this method.
/// Call resetLabelsToSkip(...) to re-enable automatic calculation.
public func setLabelsToSkip(var count: Int)
public func setLabelsToSkip(count: Int)
{
_isAxisModulusCustom = true;

if (count < 0)
{
count = 0;
axisLabelModulus = 1;
}
else
{
axisLabelModulus = count + 1;
}

_isAxisModulusCustom = true;
axisLabelModulus = count + 1;
}

/// Calling this will disable a custom number of labels to be skipped (set by setLabelsToSkip(...)) while drawing the x-axis. Instead, the number of values to skip will again be calculated automatically.
Expand All @@ -105,4 +108,4 @@ public class ChartXAxis: ChartAxisBase
{
return _isAxisModulusCustom;
}
}
}

0 comments on commit 1b3daa1

Please sign in to comment.