Skip to content

Conversation

@aruljenithberkmans
Copy link
Contributor

Bug Description

When clear the annotations collection the view annotation was not cleared in MAUI Charts.

Root Cause

Reset part of the code was not implemented.

Reason for the bug (maybe some wrong condition or wrong code)

Not tested this case previously.

Action taken:

  • The ResetAnnotation method was implemented to clear all annotations. It traverses the annotation layout collection in reverse and removes view item only because, in Annotation layout have annotation drawable view and this was need for again for other drawable annotations. If clear, the invalidate drawable was called and cleared. So, removed the view only from layout.

Is Breaking issue?

No

Solution description

  • The solution involves implementing a loop within the ResetAnnotation method to remove all views (ViewAnnotation.View) from the AnnotationLayout.

Output screenshots

Before changes:

AnnotationBeforeChanges.mp4

After changes:

AfterAnnotationChanges.mp4

Areas affected and ensured

  • SfCartesianChart

New Test cases

List out the test cases.

  • Test the annotation add and remove dynamically.
  • Test the clear function dynamically in annotation collection.
  • Test with Rectangle annotation (Drawable annotation) layout and view annotation.

Does it have any known issues?

No

Copy link
Collaborator

@Saravanan-Madhesh Saravanan-Madhesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes are fine.

@Saravanan-Madhesh
Copy link
Collaborator

@PaulAndersonS Please review and merge.

@PaulAndersonS PaulAndersonS merged commit f1dfe56 into syncfusion:main Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants