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

Make getBarBounds callable from Objective-C code (Fixes #570) #571

Merged
merged 1 commit into from Nov 26, 2015
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions Charts/Classes/Charts/BarChartView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ public class BarChartView: BarLineChartViewBase, BarChartDataProvider
}

/// - returns: the bounding box of the specified Entry in the specified DataSet. Returns null if the Entry could not be found in the charts data.
public func getBarBounds(e: BarChartDataEntry) -> CGRect!
public func getBarBounds(e: BarChartDataEntry) -> CGRect
{
let set = _data.getDataSetForEntry(e) as! BarChartDataSet!

if (set === nil)
{
return nil
return CGRectNull
}

let barspace = set.barSpace
Expand Down
6 changes: 3 additions & 3 deletions Charts/Classes/Charts/HorizontalBarChartView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ public class HorizontalBarChartView: BarChartView
}
}

public override func getBarBounds(e: BarChartDataEntry) -> CGRect!
public override func getBarBounds(e: BarChartDataEntry) -> CGRect
{
let set = _data.getDataSetForEntry(e) as! BarChartDataSet!

if (set === nil)
{
return nil
return CGRectNull
}

let barspace = set.barSpace
Expand Down Expand Up @@ -205,4 +205,4 @@ public class HorizontalBarChartView: BarChartView

return Int((pt.y >= CGFloat(chartXMax)) ? CGFloat(chartXMax) / div : (pt.y / div))
}
}
}