clone chart legend

2 posts, 0 answers
  1. Tamas
    Tamas avatar
    33 posts
    Member since:
    Jun 2010

    Posted 06 Sep 2010 Link to this post


    I'd like to display the legend of a RadChart out of the chart. Is this possible? I have a tabcontrol with several tabitems. There is a tabitem with a radchart on it, which is filled with data and the legend items are generated automatically. After this I'd like to display the legend of the chart in another tabitem.

    Is this possible?

    Many thanks and best regards,
  2. Giuseppe
    Giuseppe avatar
    2363 posts

    Posted 09 Sep 2010 Link to this post

    Hello Tamas,

    You can achieve the desired effect like this:

    <telerik:RadTabControl Height="600" Width="800">
        <telerik:RadTabItem Header="Chart">
            <telerik:RadChart x:Name="RadChart1" >
                            <telerik:ChartArea Legend="{Binding ElementName=ChartLegend1}" />
                            <telerik:ChartLegend Visibility="Collapsed" />
        <telerik:RadTabItem Header="Legend">
            <telerik:ChartLegend x:Name="ChartLegend1" />

    public partial class MainPage : UserControl
        public MainPage()
            Random rand = new Random(123456);
            List<ChartData> data = new List<ChartData>();
            for (int i = 0; i < 10; i++)
                data.Add(new ChartData() { XValue = i, YValue = rand.Next(10, 100) });
            SeriesMapping sm = new SeriesMapping();
            sm.ItemMappings.Add(new ItemMapping("XValue", DataPointMember.XValue));
            sm.ItemMappings.Add(new ItemMapping("YValue", DataPointMember.YValue));
            RadChart1.DefaultSeriesDefinition = new DoughnutSeriesDefinition();
            RadChart1.ItemsSource = data;
    public class ChartData
        public double YValue
        public double XValue

    Hope this helps.

    Kind regards,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top