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.
Unfortunately, activation email could not send to your email. Please try again.

Zooming and Panning in Xamarin.Android

Thread ID:

Created:

Updated:

Platform:

Replies:

120884 Oct 24,2015 08:25 PM Oct 26,2015 07:15 AM Xamarin.Android 1
loading
Tags: SfChart
Cathryn McDonald
Asked On October 24, 2015 08:25 PM

How do you enable zooming and panning in Xamarin.Android? Android and Xamarin.Forms both have a ChartZoomPanBehaviour class, but this class seems to be missing in Xamarin.Android.

Yuvaraj Palanisamy [Syncfusion]
Replied On October 26, 2015 07:15 AM

Hi Cathryn,


Thanks for using Syncfusion products.


We have ChartZoomPanBehavior class in the Xamarin.Android. Also, please refer to the following code example to enable the chart zooming in the Xamarin.Android, Xamarin.Forms and Android platforms.


Xamarin.Android[C#]

SfChart chart = new SfChart();
chart.Behaviors.Add(new ChartZoomPanBehavior());


Xamarin.Forms[C#]

SfChart chart = new SfChart();
chart.ChartBehaviors.Add(new ChartZoomPanBehavior());


Xamarin.Forms [XAML]
<chart:SfChart HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
    <chart:SfChart.ChartBehaviors>
        <chart:ChartZoomPanBehavior/>
    </chart:SfChart.ChartBehaviors>
</chart:SfChart>

Android[Java]

SfChart chart = new SfChart();
chart.getBehaviors.add(new ChartZoomPanBehavior());


Thanks,
Yuvaraj

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;