diff --git a/maui-toolkit-toc.html b/maui-toolkit-toc.html index 5228be80..d5dd89d2 100644 --- a/maui-toolkit-toc.html +++ b/maui-toolkit-toc.html @@ -158,8 +158,9 @@
  • Tooltip
  • Trackball
  • Zooming and Panning
  • +
  • Performance
  • Exporting
  • -
  • Localization
  • +
  • Localization
  • How to
  • @@ -205,6 +207,7 @@
  • Legend
  • Selection
  • Tooltip
  • +
  • Performance
  • Exporting
  • @@ -331,6 +334,7 @@
  • Data Label
  • Legend
  • Tooltip
  • +
  • Performance
  • Exporting
  • diff --git a/maui-toolkit/Cartesian-Charts/Enable-ListenPropertyChange-In-Charts.md b/maui-toolkit/Cartesian-Charts/Enable-ListenPropertyChange-In-Charts.md new file mode 100644 index 00000000..57b74877 --- /dev/null +++ b/maui-toolkit/Cartesian-Charts/Enable-ListenPropertyChange-In-Charts.md @@ -0,0 +1,90 @@ +--- +layout: post +title: Enable ListenPropertyChange in .NET MAUI Charts | Syncfusion +description: Learn how ListenPropertyChange in Syncfusion® .NET MAUI Chart (SfCartesianChart) control enables real-time data updates. +platform: maui-toolkit +control: SfCartesianChart +documentation: ug +keywords: .net maui chart listenpropertychange, maui chart property change, real-time chart updates, maui chart dynamic updates, listen property change feature, maui chart real-time data, listen property change +--- + +# ListenPropertyChange in .NET MAUI Charts + +The ListenPropertyChange property in .NET MAUI Charts allows the chart to update dynamically when the underlying data source properties change. This enables real-time dynamic and data visualization. + +By leveraging INotifyPropertyChanged, the data points now automatically reflect changes, ensuring the chart remains in real time and responsive to data updates. + +To enable property change notifications, your data model must implement the INotifyPropertyChanged interface, as shown in the code below: + +**C#** + +{% highlight C# %} + + public class DataModel : INotifyPropertyChanged + { + private string category; + private double metric; + + public string Category + { + get => category; + set + { + if (category != value) + { + category = value; + OnPropertyChanged(nameof(Category)); + } + } + } + + public double Metric + { + get => metric; + set + { + if (metric != value) + { + metric = value; + OnPropertyChanged(nameof(Metric)); + } + } + } + + public event PropertyChangedEventHandler? PropertyChanged; + + protected void OnPropertyChanged(string propertyName) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + } + +{% endhighlight %} + +## Enabling ListenPropertyChange in Charts + +When your data model implements INotifyPropertyChanged, you need to set the ListenPropertyChange property of the series to `true`, to make the chart listen to the property changes of your data object. + +**XAML** + +{% highlight xaml %} + + + + . . . + + + + . . . + + + +{% endhighlight %} + +By default, ListenPropertyChange is set to `false` to prevent unnecessary event registrations and potential performance overhead. + +N> Enabling ListenPropertyChange registers the PropertyChanged event of every object in the data source. If your dataset contains a large number of data points, this may impact on the chart’s loading performance. + diff --git a/maui-toolkit/Cartesian-Charts/Performance.md b/maui-toolkit/Cartesian-Charts/Performance.md new file mode 100644 index 00000000..49829de6 --- /dev/null +++ b/maui-toolkit/Cartesian-Charts/Performance.md @@ -0,0 +1,19 @@ +--- +layout: post +title: Performance in .NET MAUI Charts | Syncfusion +description: Learn about Performance in Syncfusion® .NET MAUI Chart (SfCartesianChart), its elements and more details. +platform: maui-toolkit +control: SfCartesianChart +documentation: ug +--- + +# Performance in .NET MAUI Charts + +* If your underlying data object implements INotifyPropertyChanged, you can enable the `ListenPropertyChange` property on the series to make the chart listen to the property changes of your data objects. + +* However, enabling the ListenPropertyChange property registers the PropertyChanged event for every object in the data source. + +* When dealing with a large number of data points, registering these events can slow down the chart's loading time. + +* To optimize performance and avoid unnecessary event registration, the ListenPropertyChange property is set to `false`. + diff --git a/maui-toolkit/Circular-Charts/Performance.md b/maui-toolkit/Circular-Charts/Performance.md new file mode 100644 index 00000000..5c8f61bf --- /dev/null +++ b/maui-toolkit/Circular-Charts/Performance.md @@ -0,0 +1,19 @@ +--- +layout: post +title: Performance in .NET MAUI Charts | Syncfusion +description: Learn about Performance in Syncfusion® .NET MAUI Chart (SfCircularChart), its elements and more details. +platform: maui-toolkit +control: SfCircularChart +documentation: ug +--- + +# Performance in .NET MAUI Charts + +* If your underlying data object implements INotifyPropertyChanged, you can enable the `ListenPropertyChange` property on the series to make the chart listen to the property changes of your data objects. + +* However, enabling the ListenPropertyChange property registers the PropertyChanged event for every object in the data source. + +* When dealing with a large number of data points, registering these events can slow down the chart's loading time. + +* To optimize performance and avoid unnecessary event registration, the ListenPropertyChange property is set to `false`. + diff --git a/maui-toolkit/Polar-Charts/Performance.md b/maui-toolkit/Polar-Charts/Performance.md new file mode 100644 index 00000000..6d9af478 --- /dev/null +++ b/maui-toolkit/Polar-Charts/Performance.md @@ -0,0 +1,19 @@ +--- +layout: post +title: Performance in .NET MAUI Charts | Syncfusion +description: Learn about Performance in Syncfusion® .NET MAUI Chart (SfPolarChart), its elements and more details. +platform: maui-toolkit +control: SfPolarChart +documentation: ug +--- + +# Performance in .NET MAUI Charts + +* If your underlying data object implements INotifyPropertyChanged, you can enable the `ListenPropertyChange` property on the series to make the chart listen to the property changes of your data objects. + +* However, enabling the ListenPropertyChange property registers the PropertyChanged event for every object in the data source. + +* When dealing with a large number of data points, registering these events can slow down the chart's loading time. + +* To optimize performance and avoid unnecessary event registration, the ListenPropertyChange property is set to `false`. +