From dc159829f2890625eb147311ee505157db42b6cb Mon Sep 17 00:00:00 2001 From: aruljenithberkmans <124584591+aruljenithberkmans@users.noreply.github.com> Date: Wed, 23 Apr 2025 13:12:54 +0530 Subject: [PATCH] Update reset annotation --- maui/src/Charts/SfCartesianChart.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/maui/src/Charts/SfCartesianChart.cs b/maui/src/Charts/SfCartesianChart.cs index b701ae5e..77c8fb8f 100644 --- a/maui/src/Charts/SfCartesianChart.cs +++ b/maui/src/Charts/SfCartesianChart.cs @@ -1959,6 +1959,17 @@ void ScheduleUpdateChart() void ResetAnnotation() { + int i = _annotationLayout.Children.Count - 1; + if (i < 0) return; + + do + { + if (_annotationLayout.Children[i] is not AnnotationDrawableView view) + { + _annotationLayout.Children.RemoveAt(i); + } + i--; + } while (i >= 0); } void RemoveAnnotation(int index, object item)