Open BC-clegras opened 11 months ago
Yep, looks weird. I'll see if I can create Dart-only repro for this issue to see if it's fl_chart's issue of Flet's.
Awesome, thank you very much!
Nah, it works right in Flutter. Must be something in Flet 😳. I've tried this and that but no avail 🥹 Need more time to investigate. Will get back to this issue after some other items. Looks like the only "workaround" now is disabling animation. Sorry about that.
Ok, thank you!
Description
I am trying to use Flet to display a line chart of real time data. To do this, I'd like to be able to have a sliding window of data to show the last x seconds of data.
I am currently using the
LineChart
Control to display my data. When adding the first x data points to fill my graph, the animation looks as I believe it should. However, when the graph is filled and I start to try having a sliding window of data, the animation looks quite strange. The animation doesn't look weird if I don't remove the previous data from the graph, but then the previous data gets displayed outside the chart.Code example to reproduce the issue:
Describe the results you received:
https://github.com/flet-dev/flet/assets/135861404/c8a7b4be-b54b-41ac-9e79-053c2ab92c08
Describe the results you expected:
https://github.com/flet-dev/flet/assets/135861404/0b2ea185-e854-4c5c-a05c-f41ef0f725f1
Basically, I would like to have the nice sliding animation that is in the second recording without the chart displaying out of bounds. The only difference between both recordings is that line 100 (
data[0].data_points.pop(0)
) is commented out in the second one.Additional information you deem important (e.g. issue happens only occasionally):
Flet version (
pip show flet
):Operating system:
Windows 10 Enterprise 22H2
Additional environment details: