NPlot.VerticalLine.Draw C# (CSharp) Метод

Draw() публичный Метод

Draws the vertical line plot on a GDI+ surface against the provided x and y axes.
public Draw ( Graphics g, PhysicalAxis xAxis, PhysicalAxis yAxis ) : void
g System.Drawing.Graphics The GDI+ surface on which to draw.
xAxis PhysicalAxis The X-Axis to draw against.
yAxis PhysicalAxis The Y-Axis to draw against.
Результат void
        public void Draw(Graphics g, PhysicalAxis xAxis, PhysicalAxis yAxis)
        {
            int yMin = yAxis.PhysicalMin.Y;
            int yMax = yAxis.PhysicalMax.Y;

            yMin -= pixelIndent_;
            yMax += pixelIndent_;

            float length = Math.Abs(yMax - yMin);
            float lengthDiff = length - length * scale_;
            float indentAmount = lengthDiff / 2;

            yMin -= (int)indentAmount;
            yMax += (int)indentAmount;

            int xPos = (int)xAxis.WorldToPhysical(value_, false).X;

            g.DrawLine(pen_, new Point(xPos, yMin), new Point(xPos, yMax));

            // todo:  clip and proper logic for flipped axis min max.
        }