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?