Could we set Min and Max y-axis range?

Aug 13, 2015 at 9:31 PM
Our application needs to show "Threshold" line in the plot.
For an example the Threshold value is 1000.
If the y data range is between 5000 ~ 10000 or between 10 ~ 100, the threshold (1000) line will not be displayed in the plot.

Is there a way that we can set y-axis Min and Max range? Thx!
Aug 13, 2015 at 11:30 PM
found the solution in the thread: http://dynamicdatadisplay.codeplex.com/discussions/281164

public class DisplayRange
 {
     public double Start { get; set; }
     public double End { get; set; }

    public DisplayRange(double start, double end)
     {
         Start = start;
         End = end;
     }
}

public class ViewportAxesRangeRestriction : IViewportRestriction
 {
    public DisplayRange XRange = null;
     public DisplayRange YRange = null;

     public Rect Apply(Rect oldVisible, Rect newVisible, Viewport2D viewport)
     {

        if (XRange != null)
         {
             newVisible.X = XRange.Start;
             newVisible.Width = XRange.End - XRange.Start;
         }

         if (YRange != null)
         {
             newVisible.Y = YRange.Start;
             newVisible.Height = YRange.End - YRange.Start;
         }

        return newVisible;
     }

     public event EventHandler Changed;
 }
..
        plotter.Viewport.AutoFitToView = true;
         ViewportAxesRangeRestriction restr = new ViewportAxesRangeRestriction();
         restr.YRange = new DisplayRange(-5, 105);
         plotter.Viewport.Restrictions.Add(restr);