beto-rodriguez / LiveCharts2

Simple, flexible, interactive & powerful charts, maps and gauges for .Net, LiveCharts2 can now practically run everywhere Maui, Uno Platform, Blazor-wasm, WPF, WinForms, Xamarin, Avalonia, WinUI, UWP.
https://livecharts.dev
MIT License
4.25k stars 552 forks source link

Cartesian chart swipe only works when swiping in a straight horizontal line - .NET MAUI (Android) #1343

Open williamschill opened 10 months ago

williamschill commented 10 months ago

When swiping between values in a cartesian chart, the tooltip and crosshair only moves if you swipe in a completely straight horizontal line on Android. For example, if your finger swipes diagonally across the chart, the tooltip and crosshair does not follow your finger. It works fine on iOS but not on Android.

Animation

To reproduce Create a simple CartesianChart with ZoomMode=None in a .NET Maui project and add a Series. Try to swipe between the values in the chart and notice that you need to swipe in a straight horizontal line in order for the tooltip/crosshair to move.

Expected behavior The tooltip/crosshair should follow your finger in every direction as long as you are inside the chart.

Smartphone (please complete the following information):

beto-rodriguez commented 10 months ago

what is the parent control of your chart? I am able to reproduce this issue when the chart is inside a ScrollView, the scroll view is handling the event and the chart is not receiving the touch event.

scroll

williamschill commented 10 months ago

Yes, it is inside a scrollview.

beto-rodriguez commented 10 months ago

This will be improved in the next version of the library with #1349, but I am afraid that it is not completely fixed, it seems that there is no way in Maui to get the touch event in both (the chart and the scrollview) on Android, it will work perfectly on iOS with #1349, issue is raised to Maui.