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

Chart Legend Items

6 Answers 146 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Chris Thierry
Top achievements
Rank 1
Chris Thierry asked on 21 Oct 2010, 04:52 PM
Hi,
    I'm using a piechart generating items automatically. How can I access to this collection of items? if I try to use:

myChart.DefaultView.ChartLegend.Items but the count is always 0

Another question: Can I remove the legend click event keeping only the item click?, for example I want to click in a piechart item, the item become exploded but I don't want the same efect if user click on the legend item.  

Thank you.

6 Answers, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 22 Oct 2010, 10:04 AM
Hello Chris Thierry,

Due to the specifics of the legend control (we wanted the user to be able to add manually legend items even when the rest are auto-generated -- this is basically not supported out-of-the-box by the WPF/Silverlight control), you need to cast the ChartLegend to its base type to access the items like this (you can call this in the DataBound event handler for example):

(myChart.DefaultView.ChartLegend as ItemsControl).Items

Hope this helps.


All the best,
Freddie
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
Chris Thierry
Top achievements
Rank 1
answered on 22 Oct 2010, 01:21 PM
OK thanks for your answer.
What about the second question?
Thank you.
0
Giuseppe
Telerik team
answered on 27 Oct 2010, 06:38 PM
Hi Chris,

Unfortunately this functionality is not supported at the moment -- it is not possible to restrict the interactivity within the series items only and not the legend items as well.

We will forward your feedback to our developers so they can consider implementing such option for one of the next versions of the control.


Regards,
Freddie
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
Chris Thierry
Top achievements
Rank 1
answered on 27 Oct 2010, 08:42 PM
Thank you!
Do you know if in the next version we will be able to create a pie chart with an item already exploded?
Thank you again
0
Giuseppe
Telerik team
answered on 29 Oct 2010, 05:50 PM
Hi Chris,

This will be possible -- find attached a sample application that uses the BETA binaries and demonstrates how you can achieve the desired effect.

Hope this helps.


Kind regards,
Freddie
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
Chris Thierry
Top achievements
Rank 1
answered on 29 Oct 2010, 06:29 PM
Thank you very much!!!
Tags
Chart
Asked by
Chris Thierry
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Chris Thierry
Top achievements
Rank 1
Share this question
or