Avoiding Labels overlaping in X Axis

3 posts, 1 answers
  1. Daní
    Daní avatar
    303 posts
    Member since:
    Feb 2008

    Posted 28 Oct 2009 Link to this post

    Hi,

    I'm using the RadChart in an application where the number of point to plots is variable. That means that when many points are supplied the labels on x-axis are overlapped. Is there any workaround to draw only as many x-labels to ensure they are not overlapped.

    Thanks.
  2. Answer
    Ves
    Admin
    Ves avatar
    2879 posts

    Posted 30 Oct 2009 Link to this post

    Hello Daní,

    If you have databound the XValue of the chart DataPoints (like adding an ItemMapping for XValue) you can take advantage of the TicksDistance property of AxisX. This property defines the minimum distance between two ticks along the X axis. In case there are lots of items, RadChart will calculate the ticks and label in a way that ticks are no closer than the value of this property.

    If you are not setting XValue, TicksDistance will be ignored, so you may consider using the LabelStep property. Setting it to 3 will force the chart to display only every third label.

    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.
  3. DevCraft banner
  4. Daní
    Daní avatar
    303 posts
    Member since:
    Feb 2008

    Posted 30 Oct 2009 Link to this post

    Thanks Ves, that solves my problem.
Back to Top