2 different colors using Draw Text
Created at 21 Apr 2013, 21:06
2 different colors using Draw Text
21 Apr 2013, 21:06
is there a way to use 2 or more colors for text displayed using static positioning? For exapmle, if i use:
ChartObjects.DrawText("test","Hello"+"world", StaticPosition.TopCenter);
is there a way to display hello in red and world in blue?
Replies
cAlgo_Fanatic
22 Apr 2013, 10:48
You would have to split it into two objects. The second object should be padded with spaces to the left so that it does not overlap the first.
Also consider using "\t" - tabulation:
ChartObjects.DrawText("text1", "Hello", StaticPosition.TopLeft, Colors.Green); ChartObjects.DrawText("text2", "\tWorld", StaticPosition.TopLeft, Colors.Yellow);
@cAlgo_Fanatic
Scott
21 Apr 2013, 22:33
RE:
I would also like to be able to do this for the fractional pip
yPos = _simpleMovingAverage2.Result[index];
text = String.Format("{0}", Math.Round(yPos, Symbol.Digits));
ChartObjects.DrawText("obj2", text, xPos, yPos, VerticalAlignment.Bottom, HorizontalAlignment.Left,Colors.Yellow);
@Scott