We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

But with PieSeries.ExplodeIndex

Thread ID:

Created:

Updated:

Platform:

Replies:

116552 Jun 9,2014 06:56 AM Jun 14,2014 04:48 AM Windows Phone 3
loading
Tags: Chart
Alexey Stachikov
Asked On June 9, 2014 06:56 AM


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;


Suresh S [Syncfusion]
Replied On June 10, 2014 07:48 AM

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 


Attachment: Sample_7acd4ebf.zip

Alexey Stachikov
Replied On June 10, 2014 07:55 AM

Thank you. This works

Suresh S [Syncfusion]
Replied On June 14, 2014 04:48 AM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;