Skip to content

Commit

Permalink
Moved xAxis getter
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgindi committed Mar 30, 2016
1 parent b7192ca commit fa5d01f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
8 changes: 0 additions & 8 deletions Charts/Classes/Charts/BarLineChartViewBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1688,14 +1688,6 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
return _rightAxis
}
}

/// - returns: the object representing all x-labels, this method can be used to
/// acquire the XAxis object and modify it (e.g. change the position of the
/// labels)
public var xAxis: ChartXAxis
{
return _xAxis
}

/// flag that indicates if pinch-zoom is enabled. if true, both x and y axis can be scaled simultaneously with 2 fingers, if false, x and y axis can be scaled separately
public var pinchZoomEnabled: Bool
Expand Down
8 changes: 8 additions & 0 deletions Charts/Classes/Charts/ChartViewBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ public class ChartViewBase: NSUIView, ChartDataProvider, ChartAnimatorDelegate
{
// MARK: - Properties

/// - returns: the object representing all x-labels, this method can be used to
/// acquire the XAxis object and modify it (e.g. change the position of the
/// labels)
public var xAxis: ChartXAxis
{
return _xAxis
}

/// the default value formatter
internal var _defaultValueFormatter: NSNumberFormatter = ChartUtils.defaultValueFormatter()

Expand Down
7 changes: 7 additions & 0 deletions Charts/Classes/Charts/PieChartView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public class PieChartView: PieRadarChartViewBase
super.initialize()

renderer = PieChartRenderer(chart: self, animator: _animator, viewPortHandler: _viewPortHandler)
_xAxis = nil
}

public override func drawRect(rect: CGRect)
Expand Down Expand Up @@ -245,6 +246,12 @@ public class PieChartView: PieRadarChartViewBase
return CGFloat(value) / CGFloat(yValueSum) * _maxAngle
}

/// This will throw an exception, PieChart has no XAxis object.
public override var xAxis: ChartXAxis
{
fatalError("PieChart has no XAxis")
}

public override func indexForAngle(angle: CGFloat) -> Int
{
// take the current angle of the chart into consideration
Expand Down
6 changes: 0 additions & 6 deletions Charts/Classes/Charts/RadarChartView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,6 @@ public class RadarChartView: PieRadarChartViewBase
return _yAxis
}

/// - returns: the object that represents all x-labels that are placed around the RadarChart.
public var xAxis: ChartXAxis
{
return _xAxis
}

/// Sets the number of web-lines that should be skipped on chart web before the next one is drawn. This targets the lines that come from the center of the RadarChart.
/// if count = 1 -> 1 line is skipped in between
public var skipWebLineCount: Int
Expand Down

0 comments on commit fa5d01f

Please sign in to comment.