I have been searching on SfChart documentation and I didn't find anything related to swipping gestures. But I see other controls has it. Is any example where there is a sfchart with swipping?
|
<chart:SfChart x:Name="chart" InputTransparent="False"
HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<chart:SfChart.GestureRecognizers>
<SwipeGestureRecognizer Direction="Left" Swiped="SwipeGestureRecognizer_Swiped" Threshold="1"/>
<SwipeGestureRecognizer Direction="Right" Swiped="SwipeGestureRecognizer_Swiped" Threshold="1"/>
</chart:SfChart.GestureRecognizers>
. . .
</chart:SfChart> |
|
private void SwipeGestureRecognizer_Swiped(object sender, SwipedEventArgs e)
{
// Do Something
} |
Hi Yuvaraj,
Thank you for the example but I have one more doubt, is it possible to set a command in Swiped event? I didn't find Command like Button Click has.
|
<chart:SfChart.GestureRecognizers>
<SwipeGestureRecognizer Direction="Left" Command="{Binding SwipeCommand}" Threshold="1"/>
<SwipeGestureRecognizer Direction="Right" Command="{Binding SwipeCommand}" Threshold="1"/>
</chart:SfChart.GestureRecognizers>
|
|
public Command SwipeCommand { get; set; }
public ViewModel()
{
. . .
SwipeCommand = new Command(Swipe);
}
private void Swipe(object obj)
{
// Do Something
} |