Skip to content

Commit

Permalink
Merge pull request ChartsOrg#571 from adonaire-sage/objc-get-bar-bounds
Browse files Browse the repository at this point in the history
Make getBarBounds callable from Objective-C code (Fixes ChartsOrg#570)
  • Loading branch information
danielgindi committed Nov 26, 2015
2 parents a942a4a + 8cf8d1a commit d6ca409
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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))
}
}
}

0 comments on commit d6ca409

Please sign in to comment.