oxyplot / oxyplot

A cross-platform plotting library for .NET
https://oxyplot.github.io/
MIT License
3.29k stars 962 forks source link

Recognize swipe gestures #579

Open joshisunil-1983 opened 9 years ago

joshisunil-1983 commented 9 years ago

Hi,

I am using oxyplot for my window phone app(8.1). i want recognize the swipe gesture on chart. currently oxyplot provide touch events for chart so how can use these events to recognize the swipe gesture on chart.

Please guide my if anyone implement the gestures. thnx

TheAlmightyBob commented 9 years ago

Not quite clear what your goal is. Do you actually need the gesture from the plot model? If not, and you only care about WinPhone, and you're just trying to replace the built-in pan/zoom gesture support with your own swipe gesture, you could just derive a custom class from PlotView and override the OnManipulationStarted/Delta/Completed methods.

joshisunil-1983 commented 9 years ago

Thanks, In my app i am having a Flipview which contains three different views. chart is on the top of the Flipview. functionality of flip not working when chart is on top. so i want make it work. that is why swipe gesture required from plot mode. flipview working when i set the chart.ManipulationMode = ManipulationModes.System ; but after setting this scale and zoom not working. please guide @TheAlmightyBob.

TheAlmightyBob commented 9 years ago

I'm not familiar with FlipView and not very experienced with Windows Phone, but just conceptually things will be a bit complicated if you're trying to support both panning and swiping. How do you know the difference? Your last message only says "scale and zoom," but generally panning is expected if zoom is supported. (if not, maybe you could get away with combining the System ManipulationMode with Scale... but I have no idea if/how that would work) It generally sounds like you're going to need to override the OnManipulationStarted/Delta/Completed methods and figure out for yourself some way to determine whether a gesture is intended for the chart or the FlipView (only call the base class implementation if it's intended for the chart, otherwise leave the event unhandled). Again note that I'm not a WinPhone expert so there may be further complications I'm unaware of.

This seems like it would be a confusing user experience to me, but I haven't seen your app.