Multiline annotation text alignment

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Arction_LasseP

greggorob64
Posts: 183
Joined: Tue Mar 18, 2014 2:55 pm

Multiline annotation text alignment

Post by greggorob64 » Mon May 23, 2016 4:08 pm

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.

User avatar
ArctionPasi
Posts: 1366
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland

Re: Multiline annotation text alignment

Post by ArctionPasi » Mon May 23, 2016 4:28 pm

Please set annotation.TextStyle.MultilineTextHorizontalAlign = Center.

We've got properties, you know :-)
LightningChart Support Team, PT

greggorob64
Posts: 183
Joined: Tue Mar 18, 2014 2:55 pm

Re: Multiline annotation text alignment

Post by greggorob64 » Mon May 23, 2016 5:15 pm

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.

User avatar
ArctionPasi
Posts: 1366
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland

Re: Multiline annotation text alignment

Post by ArctionPasi » Mon May 23, 2016 6:12 pm

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:
LightningChart Support Team, PT