Пример #1
0
        public void AxisVSpan_ExtremeZoomIn_FullScreenIsSpanColor()
        {
            var plt    = new ScottPlot.Plot();
            var axSpan = new VSpan()
            {
                Y1 = 1, Y2 = 10, Color = System.Drawing.Color.Green
            };

            plt.Add(axSpan);

            // Initial zoom to fill full plot with span color
            plt.AxisZoom(1, 10);

            var smallZoomBmp = TestTools.GetLowQualityBitmap(plt);
            var smallZoom    = new MeanPixel(smallZoomBmp);

            // Extreme zoom to prove that full plot filled with span Color
            plt.AxisZoom(1, 10_000_000);

            var extremeZoomBmp = TestTools.GetLowQualityBitmap(plt);
            var extremeZoom    = new MeanPixel(extremeZoomBmp);

            // Compare mean pixel with delta, because different ticks
            // Y Ticks has more affect on mean pixel
            Assert.AreEqual(smallZoom.RGB, extremeZoom.RGB, 20);
        }
Пример #2
0
        public VSpan PlotVSpan(
            double y1,
            double y2,
            Color?color           = null,
            double alpha          = .5,
            string label          = null,
            bool draggable        = false,
            bool dragFixedSize    = false,
            double dragLimitLower = double.NegativeInfinity,
            double dragLimitUpper = double.PositiveInfinity
            )
        {
            var axisSpan = new VSpan()
            {
                position1     = y1,
                position2     = y2,
                color         = color ?? settings.GetNextColor(),
                alpha         = alpha,
                label         = label,
                DragEnabled   = draggable,
                DragFixedSize = dragFixedSize,
            };

            axisSpan.SetLimits(null, null, dragLimitLower, dragLimitUpper);
            Add(axisSpan);
            return(axisSpan);
        }