예제 #1
0
    public static void DragZoom(IPlotControl control, MouseDrag drag, LockedAxes locked)
    {
        Pixel to2 = new(
            x: locked.X ? drag.From.X : drag.To.X,
            y: locked.Y ? drag.From.Y : drag.To.Y);

        control.Plot.MouseZoom(drag.InitialLimits, drag.From, to2);
        control.Refresh();
    }
예제 #2
0
    public static void PanRight(IPlotControl control)
    {
        double     PanFraction = 0.1;
        AxisLimits limits      = control.Plot.GetAxisLimits();
        double     deltaX      = limits.Rect.Width * PanFraction;

        control.Plot.SetAxisLimits(limits.WithPan(deltaX, 0));
        control.Refresh();
    }
예제 #3
0
    public static void PanDown(IPlotControl control)
    {
        double     PanFraction = 0.1;
        AxisLimits limits      = control.Plot.GetAxisLimits();
        double     deltaY      = limits.Rect.Height * PanFraction;

        control.Plot.SetAxisLimits(limits.WithPan(0, -deltaY));
        control.Refresh();
    }
예제 #4
0
    public static void ZoomIn(IPlotControl control, Pixel pixel, LockedAxes locked)
    {
        double zoomInFraction = 1.15;

        double xFrac = locked.X ? 1 : zoomInFraction;
        double yFrac = locked.Y ? 1 : zoomInFraction;

        control.Plot.MouseZoom(xFrac, yFrac, pixel);
        control.Refresh();
    }
예제 #5
0
 public static void DragZoomRectangle(IPlotControl control, MouseDrag drag, LockedAxes locked)
 {
     control.Plot.MouseZoomRectangle(drag.From, drag.To, vSpan: locked.Y, hSpan: locked.X);
     control.Refresh();
 }
예제 #6
0
 public static void ZoomRectangleApply(IPlotControl control)
 {
     control.Plot.MouseZoomRectangleClear(applyZoom: true);
     control.Refresh();
 }
예제 #7
0
 public static void AutoScale(IPlotControl control)
 {
     control.Plot.AutoScale();
     control.Refresh();
 }
예제 #8
0
 public static void ToggleBenchmark(IPlotControl control)
 {
     control.Plot.Benchmark.IsVisible = !control.Plot.Benchmark.IsVisible;
     control.Refresh();
 }