This is actually more like an animated drawing than a graph, really. My programming is not up to figuring out a) how to stack slices and b) how to move them from one side to another if some limit is exceeded. So effectively this is done by hand – the numbers are all entered in rather than linking of a spreadsheet and then calculated in the code.
There’s always going to be a balance between making something replicable and getting something to work once. The former means setting up lots of functions and variables, which means lots of set up time to start with and v little time to repeat later. The latter means the first one’s quick to do but the second one takes almost as long.