Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
45
XamWebChart -Programatically Hiding/unHiding Series
posted

Hello,

We are looking at a functionality where in users should be able to hide/un-hide a series from XamWebChart by clicking on the legend Items.

In LegenItem Click  event, we are using the following code to make a series invisible on the chart.

 

  LineChart.Series[i].Visibility = Visibility.Collapse.

 

The Visibility Property is changing but the Series still exists on the chart.

Please suggest. whats going wrong here.

 

 

 

 

 

Parents
  • 30692
    Suggested Answer
    Offline posted

    What you are attempting doesn't work because the series is just a template, and doesn't represent the actual visual controls that get created to render the chart. So, at the moment, setting visibility to collapsed for a series object does not have the effect you are after. Would removing the series from the chart be an option? Or temporarily removing its data points? If you remove the series as the result of a click on the legend, you may need to manually set up the legend so that series' legend item isnt removed when it is clicked also.

Reply Children