Page 1 of 1

Multiline annotation text alignment

Posted: Mon May 23, 2016 4:08 pm
by greggorob64
Hello, got something new for monday morning.

I have build a 'table tooltip' out of a ton of annotations, based on the lightning chart example, shown below

Image

Note the top annotation. It is a single annotation, set with the string:

"Marker Text\n[cmd][otherstuff]"

The cell's alignment is set with HorizAlign = AlignmentHorizontal.Center;

The bug is this: If you have a multiline annotation, the alignment seems to only work on the longest string (or something like that). As you can see, the top row of my annotation is center aligned.

Re: Multiline annotation text alignment

Posted: Mon May 23, 2016 4:28 pm
by ArctionPasi
Please set annotation.TextStyle.MultilineTextHorizontalAlign = Center.

We've got properties, you know :-)

Re: Multiline annotation text alignment

Posted: Mon May 23, 2016 5:15 pm
by greggorob64
You've foiled me yet again!

Out of curiosity, why are there two different properties for this? I just kind of assumed there'd only be one horizontal alignment property.

Also, you do have properties, literally thousands of them, can be hard to track down exactly what i'm lookin for.

Re: Multiline annotation text alignment

Posted: Mon May 23, 2016 6:12 pm
by ArctionPasi
Two properties are needed, because when Sizing != Automatic, and giving a larger size for the annotation, the HorizAlign aligns the whole text block to left edge, center, or right edge of the annotation. MultilineTextHorizontalAlign in contrast, applies only inside that text block, aligning each line based on the setting.

I hope this clarifies it a little bit :freak: