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

UIPanGesture blocked while zoomed out completely #566

Closed
Scrambles56 opened this issue Nov 23, 2015 · 2 comments
Closed

UIPanGesture blocked while zoomed out completely #566

Scrambles56 opened this issue Nov 23, 2015 · 2 comments

Comments

@Scrambles56
Copy link

Hi Daniel,

First up, I want to thank you for this library, as it has proved most useful with my current works. In my time using this library, I have come across a problem that I wanted to clear up, and find out whether it is intentional, or possible to change.

I have set up a Linechart view, with reasonably default settings. The problem is that I want to add a UIPanGestureRecognizer to the LineChartView, but the action associated to the gesture is not fired when the chart is zoomed all the way out.

Thanks,
Matt

@Scrambles56 Scrambles56 changed the title UIPanGesture blocked while not zoomed in UIPanGesture blocked while zoomed out completely Nov 23, 2015
@liuxuan30
Copy link
Member

The chart view itself contains two tap gestures and one pinch, one pan gesture. I guess you need to provide your own handler, rather than adding a new one. Or you need to solve the conflicts of the two pan gestures, like one should fail the other one.

here's the code in ChartViewBase:

    internal var _tapGestureRecognizer: UITapGestureRecognizer!
    internal var _doubleTapGestureRecognizer: UITapGestureRecognizer!
    #if !os(tvOS)
    internal var _pinchGestureRecognizer: UIPinchGestureRecognizer!
    #endif
    internal var _panGestureRecognizer: UIPanGestureRecognizer!

@danielgindi
Copy link
Collaborator

Well the thing is that when the pan gesture can interfere with scroll views, so we kind of "disable" it when there's nothing to pan.

I think you can still make this work - try to not specify the chart as the delegate for your new pan recognizer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants