Show the legend without overlapping the chart (plotarea)

Thread is closed for posting
3 posts, 1 answers
  1. Amol
    Amol avatar
    2 posts
    Member since:
    Mar 2009

    Posted 02 Mar 2009 Link to this post

    I am trying to avoid the legend overlapping the chart (plotarea). Since longer texts in the legend takes up more space i am trying the set the 

    Legend.Appearance.ItemTextAppearance.MaxLength = 50;
    But it is not working.

    Is this the best approach or is there another way so that plotarea will not be overlapped by the legend?

  2. Answer
    Velin
    Admin
    Velin avatar
    391 posts

    Posted 05 Mar 2009 Link to this post

    Hello Amol,

    The easiest way you could go is to simply set the AutoLayout property of RadChart to true. This will make all the chart elements to not overlap each other.

    The Legend.Appearance.ItemTextAppearance.MaxLength property defines the number of characters to be shown before the legend item text gets trimmed. And in case the legend item text is longer than the specified number, an ellipsis (...) sign is shown.

    Here is a sample code:
    chart.AutoLayout = true
    chart.Legend.Appearance.ItemTextAppearance.MaxLength = 20

    Hope this will help.

    Regards,
    Velin
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Amol
    Amol avatar
    2 posts
    Member since:
    Mar 2009

    Posted 06 Mar 2009 Link to this post

    Hello Velin,

    Thanks for the solution. It worked for me.

    Thanks,
    Amol
Back to Top