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

Axis labels not readable

3 Answers 75 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Jaakko Hänninen
Top achievements
Rank 1
Jaakko Hänninen asked on 28 Sep 2009, 10:22 AM
I have a problem that after run time modification labels at YAxis are not readable. I`m trying to convert time format from minutes to hour:minutes format at run time. It seems that these new labels doen`s fit to the area and result is mess. Timeformat is changed at PrePaint event handler. Control doesn`t update it`s measures after that.

protected void MyChart_PrePaint(object sender, EventArgs e)
{
            RadChart are = (RadChart)sender;
            ChartYAxis yAxis = are.PlotArea.YAxis;

            are.Series[0].Appearance.LabelAppearance.Dimensions.AutoSize = false;
            are.Series[0].Appearance.LabelAppearance.Dimensions.Width = 500;          

            yAxis.Appearance.TextAppearance.AutoTextWrap = AutoTextWrap.False;
            yAxis.Appearance.TextAppearance.Dimensions.Width = 500;
            yAxis.Appearance.TextAppearance.Dimensions.AutoSize = false;



            foreach (ChartAxisItem axisItem in yAxis.Items)
            {
                axisItem.TextBlock.Text = "some text here";
            }
}

3 Answers, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 28 Sep 2009, 01:08 PM
If they do not fit have you tried to either change the angle of the labels, or the margins of the chart image? This could provide you with some more space for the labels.

Angle:
 
RadChart1.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = -90; 


Margins:
 
RadChart1.PlotArea.Appearance.Dimensions.Margins.Right = 50; 
RadChart1.PlotArea.Appearance.Dimensions.Margins.Left = 50; 

0
Ves
Telerik team
answered on 01 Oct 2009, 06:08 AM
Hi guys,

I would suggest checking the Auto Layout feature. All you need is one property - RadChart.AutoLayout = true.

Best 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.
0
Jaseem
Top achievements
Rank 1
answered on 20 Aug 2013, 07:25 PM
Hi,

i am RadChart display data as vertical bars. but axis labels are overlapping . i have searched a lot and found that
RadChart.AutoTextWrap property can solve my issue . but i cannot find that property or even RadChart.AutoLayout property.
iam using 2012 version of telerik . please help as soon as possible,

thanks in advance


Tags
Chart (Obsolete)
Asked by
Jaakko Hänninen
Top achievements
Rank 1
Answers by
Schlurk
Top achievements
Rank 2
Ves
Telerik team
Jaseem
Top achievements
Rank 1
Share this question
or