A question about coding (bar chart race)

See also How to do this video?