Make my draw graph looks better
Here's what I came up with using a helper class:

            Draw draw = new Draw(g, borderPen, hueCount, margin, width, height);

            for (int i = 0; i &lt; hueCount - 2; ++i)
            {
                draw.DrawBorder(i);
                draw.DrawLine(redPen, i, reds, maxRed);
                draw.DrawLine(greenPen, i, greens, maxGreen);
                draw.DrawLine(bluePen, i, blues, maxBlue);
            }


...

internal sealed class Draw
{
    private readonly Graphics g;

    private readonly Pen borderPen;

    private readonly int hueCount;

    private readonly int margin;

    private readonly int doubleMargin;

    private readonly int width;

    private readonly int height;

    internal Draw(Graphics g, Pen borderPen, int hueCount, int margin, int width, int height)
    {
        this.g = g;
        this.borderPen = borderPen;
        this.hueCount = hueCount;
        this.margin = margin;
        this.doubleMargin = 2 * this.margin;
        this.width = width;
        this.height = height;
    }

    internal void DrawBorder(int i)
    {
        if (i % 6 == 0)
        {
            float x = margin + (width - doubleMargin) * (float)i / hueCount;
            float y = height - margin;

            g.DrawLine(borderPen, x, y, x, y - 5);
        }
    }

    internal void DrawLine(Pen pen, int i, int[] colors, int maxColor)
    {
        float wm = width - doubleMargin;
        float hm = height - doubleMargin;
        float mh = margin - height;

        g.DrawLine(
            pen,
            margin + ((float)i / hueCount) * wm,
            (-(float)colors[i] / maxColor) * hm - mh,
            margin + ((float)(i + 1) / hueCount) * wm,
            (-(float)colors[i + 1] / maxColor) * hm - mh);
    }
}