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

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

Draws the horizontal 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 xMin = xAxis.PhysicalMin.X;
            int xMax = xAxis.PhysicalMax.X;

            xMin += pixelIndent_;
            xMax -= pixelIndent_;

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

            xMin += (int)indentAmount;
            xMax -= (int)indentAmount;

            int yPos = (int)yAxis.WorldToPhysical(value_, false).Y;

            g.DrawLine(pen_, new Point(xMin, yPos), new Point(xMax, yPos));

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