Limiting xaxis labels

4 posts, 0 answers
  1. ongle
    ongle avatar
    2 posts
    Member since:
    May 2007

    Posted 07 Aug 2007 Link to this post

    Does anybody know how to limit the number of labels on the xaxis? I have a chart that is databound with multiple series defined. The xaxis is Time and I don't need every single timestamp printed at the bottom of the chart. This ends up cluttering the axis and makes the labels unreadable. What i'd like to do is limit the number of xaxis labels displayed (either by a specific number of labels, or specific times [e.g. every half hour]). Does anybody have any ideas?
  2. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 08 Aug 2007 Link to this post

    Hello Donald,

    The feature to restrict the number of displayed labels is already implemented, but it will be available in the Q2 release, which is scheduled for mid September.

    What you can do as a work-around until then is to hide some of the x-axis labels so that they are not displayed:
     
    for (int i = 0; i < radChart1.PlotArea.XAxis.Items.Count; i++) 
        radChart1.PlotArea.XAxis.Items[i].Visible = (i % 7 == 0); 
     
    *  In this example, for each group of 5 elements, the first will be visible and the next 4 - hidden.

    Regards,
    Evtim
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Dimondwoof
    Dimondwoof avatar
    26 posts
    Member since:
    Jul 2006

    Posted 13 Sep 2007 Link to this post

    I can't get this to work.  Under radChart1.PlotArea, there is no XAxis property.  I am using the Q1 2007 control.  I am displaying 18 months worth of data and I want the XAxix label to display the month and year only, but the data points need to be daily.
  5. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 14 Sep 2007 Link to this post

    I see. The code I sent you is for the latest available version, i.e. Q1 2007 SP2.

    The version you use is the first version of RadChart. Its API has been extended since and you can try the latest version. Or you can wait until next week when we will release the new version of RadChart.

     
    Regards,
    Evtim
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top