我使用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值之间的平移,但我找不到任何东西。你有什么想法吗?