XAxis Labels Overlap

Thread is closed for posting
2 posts, 0 answers
  1. Jason
    Jason avatar
    8 posts
    Member since:
    Oct 2008

    Posted 31 Mar 2009 Link to this post

    Hi all,

    I have a Rad Chart (horizontal bar chart) control on a page and when the control renders with my data (34 bars), the labels are all scrunched together and it looks terrible.

    I have tried setting AutoLayout="true", but it doesn't appear to do anything.

    Here's my code:

    ASPX:

                        <telerik:RadChart ID="chtResults"
                            Skin="WebBlue"
                            AutoLayout="true"
                            SeriesOrientation="Horizontal"
                            runat="server">
                        </telerik:RadChart>

    CODE BEHIND:

                    Telerik.Charting.ChartSeries Series = new Telerik.Charting.ChartSeries();
                    Series.DataYColumn = "Subscriber Count";
                    Series.Name = "Count";

                    chtResults.Series.Add(Series);
                    chtResults.PlotArea.XAxis.DataLabelsColumn = "Feed";

                    chtResults.DataSource = dtReportDataTable;
                    chtResults.DataBind();


    Any ideas how I can get the Telerik Rad Chart control to correctly render?

    Any help is greatly appreciated.

    Jason




  2. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 03 Apr 2009 Link to this post

    Hi Jason,

    There are two options to change this behavior;
    1. Decrease  the number of labels by setting theradChart1.PlotArea.XAxis.LabelStep, but since you bind the labels to the datasource, that will not do the trick (I just mention this option for you to have in mind in other cases).

    2. The other option (the only one applicable in your case) is to rotate the labels, so that they take less space:
    radChart1.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = -90;

    Kind regards,
    Evtim
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Back to Top