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.

Selecting segments

Thread ID:

Created:

Updated:

Platform:

Replies:

107678 Mar 12,2013 03:04 AM Mar 20,2013 03:42 AM Silverlight 2
loading
Tags: Chart
Hayley Tibben
Asked On March 12, 2013 03:04 AM

Hi,

I have a column chart with two series that both have selection enabled, which allows the user to select one segment in each series at any time. Is there a way to only allow one segment to be selected at any time regardless of the series??

Thanks

Karthikeyan V [Syncfusion]
Replied On March 13, 2013 07:45 AM

Hi Hayley,

Thanks for using Syncfusion products.

We have analyzed the reported requirement. You can achieve your requirement by applying the following code snippet.

Code Snippet[C#]:

void series2_MouseClick(object sender, ChartMouseEventArgs e)

{

    for (int i = 0; i < area.Series.Count; i++)

    {

       for (int j = 0; j < area.Series[i].Segments.Count; j++)

       {

           if (area.Series[i].Segments[j].Interior != area.Series[i].Interior)

           {

              area.Series[i].Segments[j].Interior = area.Series[i].Interior;

              break;

           }

        }

    }

    e.Segment.Interior = Brushes.Yellow;

}  

We have prepared the sample based on this, please find the sample in the following location.

Please let us know, if you have any concerns.

Regards,

Karthikeyan V.



SelectionSample_d5a0bcff.zip

Hayley Tibben
Replied On March 20, 2013 03:42 AM

Thanks for your help! That is exactly what I needed.

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.

;