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.
Syncfusion Feedback

How to Check/Unchech a serie in codebehind

Thread ID:

Created:

Updated:

Platform:

Replies:

117180 Aug 28,2014 11:47 AM UTC Sep 5,2014 05:15 AM UTC WPF 4
loading
Tags: SfChart
Rodolphe Billottet
Asked On August 28, 2014 11:47 AM UTC

Hi,

I would like to programmatically  check or uncheck all the series with a shortcut for instance.  

My user want to quickly hide or show all series. 

I tried the code below with the visibility which works on the series but the check box in the legend is not updated.

checkAll = !checkAll;

 foreach (FastLineSeries cs in this.lineChart.Series)            

 {                      

    cs.Visibility = checkAll ? Visibility.Visible : Visibility.Hidden;  

}

 

I want the same behavior as  click on the check box of the legend.

    


Sumathi Jayaraj [Syncfusion]
Replied On September 1, 2014 04:28 PM UTC

Hi Rodolphe,

We have analyzed your requirements and we can achieve your requirements by using CustomTemplate for ChartLegend. We have prepared a sample based on your requirements. Please find the sample in the following location.

Please let us know if you have any queries.

Regards,
Sumathi J

Attachment: VisibilityCheck_4e4dda86.zip

Sumathi Jayaraj [Syncfusion]
Replied On September 2, 2014 12:00 PM UTC

Hi Rodolphe,

We have analyzed your requirements and we would like to inform you that the check box in the legend is updated if we set the IsSeriesVisible instead of Visibility property in chartseries. Please find the sample in the following location.

 

Code Snippet[C#]:

checkAll = !checkAll;

foreach (FastLineSeries cs in this.lineChart.Series)            

{                      

    cs.IsSeriesVisible = checkAll ? true : false ;  

}

 

Please let us know if you have any queries.

 

Regards,

Sumathi J


Attachment: VisibilityCheckSample_1a671f0c.zip

Rodolphe Billottet
Replied On September 3, 2014 11:44 PM UTC

Hi Sumathi,

 

It is exactly what I was looking for.

 

Thanks

Rodolphe


Sumathi Jayaraj [Syncfusion]
Replied On September 5, 2014 05:15 AM UTC

Hi Rodolphe,

Thanks for the update.

Please let us know whether if you need further assistance from us.

Regards,
Sumathi J

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.

Warning Icon 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.Close Icon

;