This is a migrated thread and some comments may be shown as answers.

Alignment of Label Text

2 Answers 312 Views
Chart (obsolete as of Q1 2013)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jeremy Murtishaw
Top achievements
Rank 1
Jeremy Murtishaw asked on 17 Sep 2009, 09:59 PM
Hello,

This should be an easy one. I'm looking to make the X-Axis labels on my grid look identical to the one in your example here:

http://www.telerik.com/help/winforms/buildingdatabinddatabase.html

I have successfully gotten the text rotated, colored, formatted, etc, but the one thing that doesn't work is the alignment. In your example, the text is right-justified, making it hug right up against the bottom of the grid, which is nice! In my case, even when I set 

radChart.PlotArea.XAxis.Appearance.LabelAppearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Right;

It still doesn't do that, but stays center justified, so that longer strings run into the chart, and smaller strings are sitting many pixels below the bottom. How do I get my text to be aligned to the right?

Thanks!
Jeremy

2 Answers, 1 is accepted

Sort by
0
Jeremy Murtishaw
Top achievements
Rank 1
answered on 17 Sep 2009, 10:02 PM

Wow, I found the general solution right after I posted. It turns out that you need to align it to the top, instead of the right:

radChart.PlotArea.XAxis.Appearance.LabelAppearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Top;

However, I'm still having issues with labels of longer text being mis-aligned compared with labels of shorter text. Is there a way to make sure all the labels are evenly spaced, regardless of text length, but still keep them top aligned?

Thanks!
Jeremy
0
Ves
Telerik team
answered on 23 Sep 2009, 07:10 AM
Hi Jeremy,

Unfortunately, this is caused by the nature of the rotated axis labels in RadChart. The rotation is center-based, longer text appears a bit shifted. I believe the top alignment is respected.

A possible workaround here is to introduce 90 degree rotation, this way the labels will appear centered at their X positions. You may want to combine this with AutoLayout set to true, so that the chart automatically calculates the space needed for these labels.

Kind regards,
Ves
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Chart (obsolete as of Q1 2013)
Asked by
Jeremy Murtishaw
Top achievements
Rank 1
Answers by
Jeremy Murtishaw
Top achievements
Rank 1
Ves
Telerik team
Share this question
or