0

I'm using Oxyplot to show graphs. I added the horizontal Pan as following:

private void AddHorizonalPanToLinearModel(){
  var b = false;

  GraphModel.MouseDown += (s, e) =>
  {
       if (e.ChangedButton != OxyMouseButton.Left) return;
       b = true;
       CurrentMousePosition = e.Position;
  };

  GraphModel.MouseMove += (s, e) =>
  {
       _xLinearAxis.Pan(CurrentMousePosition, e.Position);

       CurrentMousePosition = e.Position;
       GraphModel.InvalidatePlot(false);
       e.Handled = true;
   };

   GraphModel.MouseUp += (s, e) => b = false;
  }

I'm looking for a solution that limits the pan between the leftmost and rightmost x-values but I can't find anything. Have you got any ideas?

ctt_it
  • 339
  • 1
  • 6
  • 22

1 Answers1

0

As explained here the solution is to set AbsoluteMinimum and AbsoluteMaximum of the axis.

Community
  • 1
  • 1
ctt_it
  • 339
  • 1
  • 6
  • 22