oxyplot-xamarin icon indicating copy to clipboard operation
oxyplot-xamarin copied to clipboard

Zoom and Pan not working in the latest version (Oxyplot xamarin forms 2.1.0)

Open IosDeveloperHarsh opened this issue 2 years ago • 1 comments
trafficstars

Facing issue with the latest code panning and zooming not working Here is configuration of the project .Net Standards - 2.0 Xamarin.forms. - 5.0.0.3578 Oxyplot.Xamarin.Forms - 2.1.0 Xamarin.Essentials - 1.7.7

`private PlotModel GetPlotModelInstance() { var model = new PlotModel { TitleFontWeight = 300, TitleColor = OxyColors.Gray, Background = OxyColors.White, };

        LinearAxis lineaXrAxis = new LinearAxis
        {
            Title = "XAxis",
            Unit = "Time",
            Position = AxisPosition.Bottom,
            AxislineColor = OxyColor.FromRgb(96, 96, 96),
            IsZoomEnabled = true,
            AxislineStyle = LineStyle.Solid,
            IsPanEnabled = true,
        };
        model.Axes.Add(lineaXrAxis);

        LinearAxis linearYAxis = new LinearAxis
        {
            Title = "YAxis",
            Position = AxisPosition.Left,
            AxislineColor = OxyColor.FromRgb(96, 96, 96),
            IsZoomEnabled = false,
            AxislineStyle = LineStyle.Solid,
            IsPanEnabled = false
        };
        model.Axes.Add(linearYAxis);

        var eulerSeries = new LineSeries
        {
            Title = "Euler, h=0.25",
            MarkerType = MarkerType.Circle,
            MarkerFill = OxyColors.Black,
        };

        eulerSeries.Points.AddRange(Euler((t, y) => Math.Cos(t), 1, 0, 14, 0.25));

        model.Series.Add(eulerSeries);

        return model;
    }

private static List<DataPoint> Euler( Func<double, double, double> f, double t0, double y0, double t1, double h) { var points = new List<DataPoint>(); double y = y0; for (double t = t0; t < t1 + h / 2; t += h) { points.Add(new DataPoint(t, y)); y += h * f(t, y); } return points; }`

Actual Output Graph is getting loaded but Zoom and Pan is not happening even if its set true

Excepted Output Graph Should zoom and Pan

IosDeveloperHarsh avatar Jul 06 '23 07:07 IosDeveloperHarsh

Same issue here, I'm using Xamarin forms and zoom and pan works on V1.0.0 but doesn't work on V2.0.0 nor V2.1.0.

Enigma86d avatar Aug 02 '23 11:08 Enigma86d