Text alignment and DrawText
Author: sedelstein
Creation Date: 3/5/2017 2:04 PM
profile picture

sedelstein

#1
Hello Eugene

I'd like to format some data to display on a chart using the DrawText function and have been learning about formatting data in C#. I have some code below, which lines up data nicely into columns and looks great when I use PrintDebug to print to the Debug Log. When I try to print the same data to the chart using DrawText function the data is no longer aligned as it is in PrintDebug. I have enclosed an attachment. Is there something obviously wrong?


CODE:
Please log in to see this code.

profile picture

LenMoz

#2
Change "Arial" to a fixed width font like "Lucida Console" or "Courier New".
profile picture

sedelstein

#3
BEAUTIFUL!

Works like a charm.

Thank you Len

Steve.....
profile picture

Eugene

#4
Or you can put to use tab character ("\t") which you have defined.
CODE:
Please log in to see this code.
profile picture

sedelstein

#5
Hi Eugene

Tab didn't seem to work as the range of values could be very wide (significant digits)
I tried that first