.net - 如何避免在 oxyplot 中达到最大值后拖动?

标签 .net wpf graph oxyplot

我有一个使用 oxyplot 的电压日期时间图,我想要的是避免用户在最后一个点之后和沿 X 轴的第一个点之前拖动。

我在 x 轴上有 DateTimeAxis 值,在 y 轴上显示电压值。 我做了这样的事情来在两个轴上添加点:

 lineSerie = new LineSeries
 {
    StrokeThickness = 2,
    MarkerSize = 3,
    CanTrackerInterpolatePoints = false,
    Smooth = false,
     LineStyle = LineStyle.Dot,
     Color = OxyColor.FromRgb(66, 134, 244)
  };
  data.ToList().ForEach(d => lineSerie.Points.Add(new DataPoint(DateTimeAxis.ToDouble(d.Time), Convert.ToDouble(d.Tesnion))));
 PlotModel.Series.Add(lineSerie); 

如何避免在 minDate 和 MaxDate 之后拖动?(假设 minDate 包含 X 轴最左边的点,maxDate 包含 X 轴最右边的点)。

最佳答案

您可以在轴上指定 AbsoluteMinimumAbsoluteMaximum。来自 source :

    /// <summary>
    /// Gets or sets the absolute maximum. This is only used for the UI control. 
    /// It will not be possible to zoom/pan beyond this limit. 
    /// The default value is <c>double.MaxValue</c>.
    /// </summary>
    public double AbsoluteMaximum { get; set; }

关于.net - 如何避免在 oxyplot 中达到最大值后拖动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41953459/

相关文章:

.net - 使用 winform 而不是 WPF 的具体优势

c# - 通过 C# WPF 表单中的代码在网络浏览器(IE 或 chrome)中打开超链接 URI(www.google.com)

algorithm - 枚举加权图中从A到B的所有路径,其中路径长度在C1和C2之间

python - 列表顺序不符合预期

c++ - make_heap 使用函数对象

c# - 为Elasticsearch日期字段提供空值

c# - 使用 ConstructorInfo 调用构造函数的反射

c# - 如何在 WPF 中序列化控件 + 代码?

c# - 使用 SmtpClient 时为 "The operations timed out"

.net - 控制台应用程序中的 Kubernetes 就绪/活跃度探测