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

Common Legend for several Charts

4 Answers 79 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Dang Tran Tuan Anh
Top achievements
Rank 1
Dang Tran Tuan Anh asked on 27 Oct 2010, 06:46 AM
Does any one know to use the 1 commond legend for several charts?

4 Answers, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 29 Oct 2010, 04:27 PM
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
0
Tamas
Top achievements
Rank 1
answered on 26 Nov 2010, 07:32 PM
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
0
Evgenia
Telerik team
answered on 01 Dec 2010, 02:34 PM
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
0
Tamas
Top achievements
Rank 1
answered on 01 Dec 2010, 03:28 PM
Hi Evgenia,

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

Best regards,
Tamas
Tags
Chart
Asked by
Dang Tran Tuan Anh
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Tamas
Top achievements
Rank 1
Share this question
or