Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
IosDeveloperHarsh opened this issue Jul 6, 2023 · 1 comment

Comments

@IosDeveloperHarsh
Copy link

IosDeveloperHarsh commented Jul 6, 2023

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 Euler(
Func<double, double, double> f, double t0, double y0, double t1, double h)
{
var points = new List();
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

@Enigma86d
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants