@paul_cardinale wrote:
After seeing your code, I remembered something I came up with a long time ago, See attachment.
Yes, allowing to resize is a bit tricky, but this come close. One problem is that if the history size gets smaller, you are not necessarily throwing out the oldest data, I think (?). Probably only an issue with rapidly changing data.