Oxyplot水平平移仅在最左边和最右边的点之间

时间:2016-10-12 11:06:24

标签: c# pan oxyplot

我使用Oxyplot来显示图表。我将水平平移添加如下:

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;
  }

我正在寻找一种解决方案,限制最左边和最右边的x值之间的平移,但我找不到任何东西。你有什么想法吗?

1 个答案:

答案 0 :(得分:0)

正如here所述,解决方法是设置轴的AbsoluteMinimumAbsoluteMaximum