Search code examples
androidxamarinteechart

How to disable to move TeeChart in Xamarin.Android?


I'm in trouble: I have Xamarin.Android application using TeeChart in it. After creating chart and displaing data on it, I can click on chart and drag to any place on application. May be anybody knows how to disable to move TeeChart?

var tChart1 = new TChart(this);
            tChart1.Legend.Visible = false;
            tChart1.Aspect.View3D = !tChart1.Aspect.View3D;
            tChart1.Header.Text = String.Empty;
            tChart1.Clickable = false;
            tChart1.Enabled = false;
            tChart1.Axes.Left.Labels.ValueFormat = "###.0";
            tChart1.Clickable = false;
            tChart1.Axes.Left.Visible = true;
            tChart1.Axes.Left.LabelsOnAxis = true;
            tChart1.Axes.Top.Visible = false;
            tChart1.Axes.Right.Visible = false;
            tChart1.Axes.Right.LabelsOnAxis = true;
            tChart1.Axes.Bottom.LabelsOnAxis = false;

Solution

  • With TeeChart for Xamarin.Android you can disable zooming and panning setting Zoom.Style to ZoomStyles.Classic and some zoom and Panning settings as shown here:

      tChart1.Zoom.Style = Steema.TeeChart.ZoomStyles.Classic;
      tChart1.Zoom.Allow = false;
      tChart1.Panning.Allow = Steema.TeeChart.ScrollModes.None;
    

    Please bear in mind this functionality is only available from 4.14.6.25 version published a few weeks ago. So if you are using an older version, please update it to the latest to be able to use this functionality.