-
Notifications
You must be signed in to change notification settings - Fork 652
Description
Describe the bug
Performance issue with LiveCharts2 redraw events triggered excessively when container size changes in a modal window.
To Reproduce
Steps to reproduce the behavior:
- Open a modal window that contains a LiveCharts2 chart.
- Within the modal, include dynamic content such as a textbox whose content can change (affecting layout).
- Change the content of the textbox or initiate closing of the modal.
- Observe that the chart's redraw event is triggered multiple times rapidly.
Expected behavior
The chart should only trigger a redraw event when strictly necessary. In scenarios such as closing a modal or changing unrelated content, redraws should be minimized to avoid performance issues.
Screenshots
N/A
Desktop (please complete the following information):
- OS: Windows 11/Server
Smartphone (please complete the following information):
Not tested
Additional context
The issue seems to stem from the chart detecting container size changes too sensitively, leading to multiple redraw calls in a short span of time. This is especially noticeable when closing the modal, where it causes a visible delay and poor user experience. A debouncing mechanism or optimization in the redraw logic might help mitigate this.