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

Show the legend without overlapping the chart (plotarea)

2 Answers 539 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Amol
Top achievements
Rank 1
Amol asked on 02 Mar 2009, 10:15 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Velin
Telerik team
answered on 05 Mar 2009, 09:17 AM
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.
0
Amol
Top achievements
Rank 1
answered on 06 Mar 2009, 08:39 AM
Hello Velin,

Thanks for the solution. It worked for me.

Thanks,
Amol
Tags
Chart (Obsolete)
Asked by
Amol
Top achievements
Rank 1
Answers by
Velin
Telerik team
Amol
Top achievements
Rank 1
Share this question
or