BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
private void SfChart_SelectionChanged_1(object sender, ChartSelectionChangedEventArgs e)
{
seg = (e.SelectedSegment) as ChartSegment;
ChartSeriesBase series = seg.Series;
int b1 = (series.ItemsSource as ObservableCollection<power>).IndexOf(seg.Item as power);
if ((e.SelectedSeries as PieSeries).ExplodeIndex == b1 )
(e.SelectedSeries as PieSeries).ExplodeIndex = -1;
else
(e.SelectedSeries as PieSeries).ExplodeIndex = b1;
}
But code (e.SelectedSeries as PieSeries).ExplodeIndex = -1 is not working. To de-select pie segment I have to do following:
(e.SelectedSeries as PieSeries).ExplodeIndex = 0;
(e.SelectedSeries as PieSeries).ExplodeIndex = -1;
Hi Alexey,
Thanks for using Syncfusion products.
We have analyzed the reported query. Initially the segments
are not updated, we have modified the content as shown in the below code
snippet. Also, we have prepared the sample based on your query. Please download
it from the given below location.
Code Snippet [C#]:
private void ChartBase_OnSelectionChanged(object
sender, ChartSelectionChangedEventArgs e)
{
var
seg = (e.SelectedSegment) as ChartSegment;
ChartSeriesBase
series = seg.Series;
int
b1 = (series.ItemsSource as ObservableCollection<DataValues>).IndexOf(seg.Item
as DataValues);
if
((e.SelectedSeries as PieSeries).ExplodeIndex != b1)
(e.SelectedSeries as PieSeries).ExplodeIndex = b1;
else
{
(e.SelectedSeries as PieSeries).ExplodeIndex = -1;
(e.SelectedSeries as
PieSeries).UpdateSegments(b1,NotifyCollectionChangedAction.Reset);
}
}
Please let us know if you require further assistance on this.
Regards,
Suresh S
Thanks for your update.
We are glad that the issue
resolved at your end. As always, we will be happy to assist you.
Regards,
Suresh S