Replies: 1 comment
-
I've been using Skia before and I also encountered lag when the number of items rendered within a single transformed If you have many elements animated while you are panning the chart, you may also encounter fps drops as gestures are handled on the same thread as animations, thus handling a gesture has an impact on fps when you animate something at the same time. I think, the only solution is to reduce the number of elements animated at the same time or transformed within a group at the same time. |
Beta Was this translation helpful? Give feedback.
-
Hey, I created a line chart with Skia, which holds 2 lines with gradient below them and ref lines.
The Group component holding these elements is animated inside of the canvas with PanGesture. The thing is, that it's lagging if I have more data points (1440 datapoints is the max I use at the moment).
So I tried to understand why it's lagging, but can't find the reason behind this. This is the part of the code responsible for animation:
While checking this, I noticed a few things:
withTiming
and just set chartX value directly with user swiping, there is also no lag.withTiming
duration, the lag gets smaller.I'm trying to understand where does the lag come from or how I can get rid of it. Do you have any ideas? If everything runs on UI thread, it probably shouldn't happen, no matter how many data points I have or how many components are drawn inside of Group, since they are not rerendered or redrawn while swiping.
Beta Was this translation helpful? Give feedback.
All reactions