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,
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