Skip to content

Commit

Permalink
Added delegate callback to detect when panning is finished, to potent…
Browse files Browse the repository at this point in the history
…ially allow users to manually reset the hightlight values once panning is complete
  • Loading branch information
AntonTheDev committed Aug 26, 2018
1 parent 4fca1f7 commit 767d03d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/Charts/Charts/BarLineChartViewBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,8 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD
}

_isDragging = false

delegate?.chartViewDidEndPanning?(self)
}

if _outerScrollView !== nil
Expand Down
3 changes: 3 additions & 0 deletions Source/Charts/Charts/ChartViewBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public protocol ChartViewDelegate
/// - parameter highlight: The corresponding highlight object that contains information about the highlighted position such as dataSetIndex etc.
@objc optional func chartValueSelected(_ chartView: ChartViewBase, entry: ChartDataEntry, highlight: Highlight)

/// Called when a user stop highlighting values while panning
@objc optional func chartViewDidEndPanning(_ chartView: ChartViewBase)

// Called when nothing has been selected or an "un-select" has been made.
@objc optional func chartValueNothingSelected(_ chartView: ChartViewBase)

Expand Down

0 comments on commit 767d03d

Please sign in to comment.