We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Xamarin form | Wrapping chart with GestureRecognizer

Hi SF team , 

May I know how to wrap Sfchart with GestureRecognizers ? Currently I have Chart wrapped in Stacklayout , and the Stacklayout adds a tap event like this 

tapgesture.Tapped += (sender, e) => {
//do stuff
};

mystack.GestureRecognizers.Add (tapgesture); 

But when the Chart inside the Stacklayout is clicked , it doesn't fire the event . Any options ? Thanks . 

1 Reply

MK Magesh Kumar Krishnan Syncfusion Team October 21, 2015 07:10 AM UTC

Hi Eric,

Thanks for using Syncfusion products.

The Chart handled the touch action when clicked on the Chart. We request you to add a TapGestureRecognizer to the SfChart. Please refer to the following code example.

Code Example :

C#

TapGestureRecognizer tapGesture = new TapGestureRecognizer();
tapGesture.Tapped += (sender, e) =>
{
     //your code 
};
chart.GestureRecognizers.Add(tapGesture);


 
Thanks,
Magesh Kumar K

Loader.
Live Chat Icon For mobile
Up arrow icon