TheRealTy
TheRealTy

Reputation: 2429

Disable Panning and Zooming on Teechart Monodroid

I have created a class that inherits from Steema.TeeChart.TChart I am trying to disable panning and zooming, I have the below code but it still allows the user to pan and zoom on the device.

public class BaseChart : TChart
{
    public BaseChart(Context context, string headerTitle)
        : base(context)
    {
        _headerTitle = headerTitle;
        SetDefaults();
    }

    private void SetDefaults()
    {
        Chart.Zoom.Allow = false;
        Chart.Panning.Allow = ScrollModes.None;
        Zoom.Allow = false;
        Panning.Allow = ScrollModes.None;
    }
}

Upvotes: 0

Views: 833

Answers (1)

Narcís Calvet
Narcís Calvet

Reputation: 7452

TeeChart .NET standard zoom & scrolling is not working at the present moment in the Mono for Android version. We plan supporting it in future releases feature request being TM63016321 in our issue tracking system. Recently we implemented a new feature for MfA which disables both zooming and scrolling:

  tChart1.Zoom.Style = Steema.TeeChart.ZoomStyles.None;

UPDATE: A new Zoom.Style option has been implemented: ZoomStyles.Classic. Now you can choose if you want to toggle zooming, panning and which directions are supported for both. A maintenance release has been published supporting that. The new version explains how to use ZoomStyles.Classic in the zooming/panning tutorial included, for example:

tChart1.Zoom.Allow = true; 
tChart1.Zoom.Direction = Steema.TeeChart.ZoomDirections.Both; 
tChart1.Panning.Allow = Steema.TeeChart.ScrollModes.Horizontal;

Upvotes: 1

Related Questions