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

Collection visibility is not updated properly

Thread ID:

Created:

Updated:

Platform:

Replies:

124899 Jul 7,2016 08:59 AM UTC Jul 8,2016 05:23 PM UTC WPF 1
loading
Tags: SfChart
Jeremie Clos
Asked On July 7, 2016 08:59 AM UTC

Hello,

I am trying to control the visibility of a collection of data points dynamically, and the chart doesn't update properly unless something else gets done (e.g. transposing the axes). Could you provide me with a solution or even a temporary work-around?

Regards,
Jeremie

Devi Aruna Maharasi Murugan [Syncfusion]
Replied On July 8, 2016 05:23 PM UTC

Hi Jeremie, 
  
Thanks for contacting Syncfusion Support 
  
Query: I am trying to control the visibility of a collection of data points dynamically 
  
We have analyzed your requirement. We can able to control the visibility of data points using CustomTemplate for the series, by binding visibility property from your underlying model as in below code snippet.  
  
Code example 
[XAML] 
 
   <chart:ScatterSeries  ScatterHeight="30" ScatterWidth="30"  
                         XBindingPath="Year" YBindingPath="Count" x:Name="Scatter" 
                         ItemsSource="{Binding }"> 
       <chart:ScatterSeries.CustomTemplate> 
            <DataTemplate > 
                <Canvas> 
                   <Ellipse Fill="Purple" Stretch="Fill"   
                            Visibility="{Binding Path=Item.CanVisible}" 
                            Height="{Binding ScatterHeight}"  
                            Width="{Binding ScatterWidth}"  
                            Canvas.Left="{Binding RectX}" Canvas.Top="{Binding RectY}"> 
                   </Ellipse> 
                </Canvas> 
            </DataTemplate> 
       </chart:ScatterSeries.CustomTemplate>            
   </chart:ScatterSeries> 
 
 
  
We have prepared a demo sample based on your requirement and it can be downloaded from below link, 
  
Sample: Visibility 
  
Please refer our UG documentation link to know more about series customization using the CustomTemplate property present in the series 
  
  
Query: the chart doesn't update properly unless something else gets done (e.g. transposing the axes). 
  
We can able to update the chart properly by using ListenPropertyChange property of chart series, when dynamically changing the data objects present in your underlying model. We need to enable the ListenPropertyChange property of the series, to make the chart listen to the property changes of your data object. The default value of ListenPropertyChange property is false. Please refer our UG documentation link to know more about ListenPropertyChange property, 
  
  
Regards, 
Devi 


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

;