I would like to draw up and down arrows, and have a number above or below that arrow. Here is what I have done followed by my question.
To do that I am using the following:
Rising
DrawText("arr6", false, "á", 0, Lows[6][0], 0, Color.Blue, new Font ("Wingdings", 7, FontStyle.Bold),StringAlignment.Center, Color.Empty, Color.Empty, 0);
DrawText("lab6", false, "30", 0, Lows[6][0]-3*TickSize, 0, Color.Blue, new Font ("Arial", 7, FontStyle.Bold),StringAlignment.Center, Color.Empty, Color.Empty, 0);
Falling
DrawText("arr6", false, "â", 0, Highs[6][0], 0, Color.Red, new Font ("Wingdings", 7, FontStyle.Bold),StringAlignment.Center, Color.Empty, Color.Empty, 0);
DrawText("lab6", false, "30", 0, Highs[6][0]+3*TickSize, 0, Color.Red, new Font ("Arial", 7, FontStyle.Bold),StringAlignment.Center, Color.Empty, Color.Empty, 0);
The problem is with the +-3*TickSize. Sometimes it fits but when the scaling changes, the distance needs to be increased or decreased, or arrow and number are laid over each other.
Next I tried using the font size e.g.
Rising
DrawText("arr6", false, "á", 0, Lows[6][0], 0, Color.Blue, new Font ("Wingdings", fsize, FontStyle.Bold),StringAlignment.Center, Color.Empty, Color.Empty, 0);
DrawText("lab6", false, "30", 0, Lows[6][0]-fsize*TickSize, 0, Color.Blue, new Font ("Arial", fsize, FontStyle.Bold),StringAlignment.Center, Color.Empty, Color.Empty, 0);
Falling
DrawText("arr6", false, "â", 0, Highs[6][0], 0, Color.Red, new Font ("Wingdings", fsize, FontStyle.Bold),StringAlignment.Center, Color.Empty, Color.Empty, 0);
DrawText("lab6", false, "30", 0, Highs[6][0]+fsize*TickSize, 0, Color.Red, new Font ("Arial", fsize, FontStyle.Bold),StringAlignment.Center, Color.Empty, Color.Empty, 0);
That gives me better results but it's not optimum yet.
The 'DrawTextFixed' method with its TopRight and TopBottom uses the "n's" to move up and down. I am wondering whether there's something similar to use in 'DrawText' that I am not aware of yet.
Any advice to keep arrow and number always close together and not overlapping is appreciated.
sandman
Comment