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. Image for the cookie policy date
close icon

Selecting segments

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

2 Replies

KV Karthikeyan V Syncfusion Team March 13, 2013 11:45 AM UTC

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


HT Hayley Tibben March 20, 2013 07:42 AM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon