This question is locked. New answers and comments are not allowed.
Paresh Sen
Top achievements
Rank 1
Paresh Sen
asked on 18 Dec 2012, 09:54 AM
Hi,
Is it possible to generate an unique click event for each "Pie" in a RADPieChart.
I want to do further processing based on the selected section of the chart.
Any examples will be highly appreciated.
Thanks,
Paresh
Is it possible to generate an unique click event for each "Pie" in a RADPieChart.
I want to do further processing based on the selected section of the chart.
Any examples will be highly appreciated.
Thanks,
Paresh
6 Answers, 1 is accepted
0
Hi Paresh,
Such functionality can be achieved by defining a ChartSelectionBehavior on your RadPieChart. Then you can get the current selected segments in the ChartSelectionBehavior.SelectionChanged event handler from the ChartSelectionBehavior.SelectedPoints property. Note that if you are using multiple selection, you will need to implement your own custom logic for tracking the added/removed selected points as this information is currently not passed through the event arguments.
Alexander
the Telerik team
Such functionality can be achieved by defining a ChartSelectionBehavior on your RadPieChart. Then you can get the current selected segments in the ChartSelectionBehavior.SelectionChanged event handler from the ChartSelectionBehavior.SelectedPoints property. Note that if you are using multiple selection, you will need to implement your own custom logic for tracking the added/removed selected points as this information is currently not passed through the event arguments.
Attached is a sample project which shows how to display the 'Category' property of the current selected segment in a TextBlock.
Hope this helps.
Alexander
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Xyroid
Top achievements
Rank 1
answered on 24 Jan 2013, 01:01 PM
Hi Alexander, I checked the sample you have attached. When I select any section at that time the section gets cut, how can I remove that effect ? Thanks.0
Hello Farhan,
Ivaylo Gergov
the Telerik team
Thank you for using our components.
Generally, you can remove the "exploding" effect by setting PieSeries.SelectedPointOffset to 0 and PieDataPoint.OffsetFromCenter to 0.
Unfortunately while setting up the scenario I found that we have an open issue - OffsetFromCenter property does not update its value and at this point there is no workaround. I have logged this as a bug and we will do our best to fix it in our next official release.
I am sorry for the inconvenience caused. I have updated your Telerik points for the valuable feedback.
Ivaylo Gergov
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Xyroid
Top achievements
Rank 1
answered on 25 Jan 2013, 05:06 AM
So, in short I can't remove that effect of "exploding", no ? And also I request you to give me code as I can't managed to set PieDataPoint.OffsetFromCenter property. Thanks.
0
Hello Farhan,
Yes, I confirm that for now you cannot remove the "exploding" effect. Here's the requested code sample:
Note, that the chart adds its series dynamically and you need to set this property after page is initialized (alternatively you can use the PieSeries.DataBindingComplete event handler to execute this as well).
I hope this information is useful. If you have any other questions do not hesitate to write us again.
Ivaylo Gergov
the Telerik team
Yes, I confirm that for now you cannot remove the "exploding" effect. Here's the requested code sample:
Loaded += MainPage_Loaded;void MainPage_Loaded(object sender, RoutedEventArgs e){ foreach (PieDataPoint datapoint in myChart.Series[0].DataPoints) { datapoint.OffsetFromCenter = 0; } }Note, that the chart adds its series dynamically and you need to set this property after page is initialized (alternatively you can use the PieSeries.DataBindingComplete event handler to execute this as well).
I hope this information is useful. If you have any other questions do not hesitate to write us again.
All the best,
Ivaylo Gergov
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Samir
Top achievements
Rank 1
answered on 06 Feb 2013, 08:46 PM
There's a workaround - listen for PieDataPoint.PropertyChanged and when the OffsetFromCenter property changes, set it to zero again:
.....dataPoint.PropertyChanged += DataPointPropertyChanged;..... public void DataPointPropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "OffsetFromCenter") { var pieDataPoint = (PieDataPoint) sender; pieDataPoint.OffsetFromCenter = 0; } }