I’ve made a bar graph that continually scrolls.
To accomplish this, a new line (bar) is created and added to the layer when appropriate. For the “scrolling”, each bar is individually moved using the move function on a predicted time interval. Once a bar is off the visual part of the layer, it is destroyed.
My question is, is there a more performant way to achieve this effect?
Scrolling the whole layer (rather than moving each bar) doesn’t seem like an option, since it is infinite and resizing would seem like a potential issue in time. But I could be wrong in this assumption.
Another idea would be to keep an array of the bar values and clear and recreate them on every tick rather than move them. I don’t know if that approach might offer benefits or not.