Horizontal bar chart w/ right aligned labels


Author
Message
Scott Campbell
Scott Campbell
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)
Group: Forum Members
Posts: 2, Visits: 1

Hi all, I'm trying to do something pretty simple, just right-aligning the ordinal labels on a horizontal bar chart, so that the right-most part of the label is always a given offset from the vertical axis line.  By default, these labels are centered.  I've tried:

ordinalScale.Labels.Add(myLabelText);
ordinalScale.LabelStyle.ContentAlignment = ContentAlignment.MiddleRight;

to no avail, also:

NCustomRangeLabel label = new NCustomRangeLabel();
label.Text =
myLabelText;
label.Style.ContentAlignment = ContentAlignment.MiddleRight;
ordinalScale.CustomLabels.Add(label);

which crams everything into the top left.  Any idea how to change the alignment of labels on a horizontal bar chart?

Thank you!


Blagovest Milanov
Blagovest Milanov
Supreme Being (148 reputation)Supreme Being (148 reputation)Supreme Being (148 reputation)Supreme Being (148 reputation)Supreme Being (148 reputation)Supreme Being (148 reputation)Supreme Being (148 reputation)Supreme Being (148 reputation)Supreme Being (148 reputation)
Group: Forum Members
Posts: 154, Visits: 15

Hi Scott,

Try:
ordinalScale.LabelStyle.ContentAlignment = ContentAlignment.TopCenter;

Note that from the perspective of the label "top" means closer to the axis so this should align them to the right for a vertical axis.

Hope this helps - let me know if you meet any problems.

Best regards,
Bob


Scott Campbell
Scott Campbell
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)
Group: Forum Members
Posts: 2, Visits: 1
That worked like a champ, thanks Bob!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search