Common Legend for several Charts

5 posts, 0 answers
  1. Dang Tran Tuan Anh
    Dang Tran Tuan Anh avatar
    3 posts
    Member since:
    Mar 2010

    Posted 27 Oct 2010 Link to this post

    Does any one know to use the 1 commond legend for several charts?
  2. Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 29 Oct 2010 Link to this post

    Hello Dang,

    You can show common legend for several charts if you are using Multi-Series Charts as they share one and the same Chart Area. This is described in our help article - http://www.telerik.com/help/wpf/radchart-features-multi-series-charts.html.
    Have in mind that ChartArea has property Legend and you can set it with instance of the Legend where you want your items to be shown. This could be very useful if you have two Chart Areas as their Legend property can be set with the same Legend instance so that their items will be shown in common Legend.

    Kind regards,
    Evgenia
    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
  3. Tamas
    Tamas avatar
    33 posts
    Member since:
    Jun 2010

    Posted 26 Nov 2010 Link to this post

    Hi Evgenia,

    I also have the requirement to have one legend for multiple chartareas. I have implemented what you have suggested (all the chartarea.legend point to the same legend), however my problem is that in this case every datapoint appears in the legend.

    I have multiple pie series, but the values can be different in them, so that's why I want to have one legend for all of them. For example I have 3 piecharts with the following legendlabels:

    2005, 2006, 2007
    2006, 2007, 2008
    2005, 2009, 2010

    In this case I would like to have all of them in the same legend, without duplicates, and also very important is that each year has to have the same color in every chartarea.

    How could I achieve this? Can I set the color of the datapoints in the piechart manually and set the legend items/color manually to synchronize them?

    Many thanks and best regards,
    Tamas
  4. Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 01 Dec 2010 Link to this post

    Hello Tamas,

    To be able to have two or more chart areas with a common legend you can review this help topic - http://www.telerik.com/help/silverlight/radchart-populating-with-data-creating-chart-declaratively.html (Creating a Chart with custom Layout). Have in mind that using this approach you won't be able to avoid the duplications in Chart Legend. Furthermore you can't set custom color for Pie Slice in both ChartAreas and in the Legend.  
    What I can suggest you is to follow the help topic mentioned above and maually to set the Items for Legend. This is shown here - http://www.telerik.com/help/silverlight/radchart-features-chart-legend.html (Manual Legend Items Generation).

    Regards,
    Evgenia
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  5. Tamas
    Tamas avatar
    33 posts
    Member since:
    Jun 2010

    Posted 01 Dec 2010 Link to this post

    Hi Evgenia,

    Many thanks, I could manage to build the legend manually and sync with all the chartareas.

    Best regards,
    Tamas
Back to Top