Oxyplot 水平平移仅在最左边和最右边的点之间
Oxyplot horizontal pan only between the leftmost and rightmost points
我正在使用 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 值之间的平移,但我找不到任何东西。你有什么想法吗?
如所述,解决方案是设置轴的AbsoluteMinimum
和AbsoluteMaximum
。
我正在使用 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 值之间的平移,但我找不到任何东西。你有什么想法吗?
如AbsoluteMinimum
和AbsoluteMaximum
。