Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow access to setLabelsToSkip from Objective-C. #93

Merged
merged 1 commit into from
May 19, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Allow access to setLabelsToSkip from Objective-C.
  • Loading branch information
mkubenka committed May 19, 2015
commit 8d02895d0b1c6de79c8b6b33cb455684c62ab929
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;
}
}
}