             let velocityX = sender.velocityInView(sender.view).x
             let velocityY = sender.velocityInView(sender.view).y
             
+            let (finalDeltaX, finalDeltaY) = finalPanDelta(deltaX: velocityX, deltaY: velocityY)
+
             func next(index: Int, velocityX: CGFloat, velocityY: CGFloat) {
                 dispatch_async(dispatch_get_main_queue()) {
                     

            let deltaX = lastPanTranslation.map{trans.x - $0.x} ?? trans.x
            let deltaY = lastPanTranslation.map{trans.y - $0.y} ?? trans.y
            
            lastPanTranslation = trans
            
            chart?.pan(deltaX: deltaX, deltaY: deltaY, isGesture: true, isDeceleration: false)
            
        case .Ended:
            

    
    public var maxZoomY: CGFloat?
    
    public var zoomPanGestureMode: ChartZoomPanGestureMode = .Max
    
    public init() {}
}

public enum ChartZoomPanGestureMode {
    case OnlyX // Only X axis is zoomed/panned
    case OnlyY // Only Y axis is zoomed/panned
    case Max // Only axis corresponding to dimension with max zoom/pan delta is zoomed/panned
    case Both // Both axes are zoomed/panned
}

public protocol ChartDelegate {
