Using Keys to Retain Bar Identity

An illustration of the use of the key function, to retain object consistency between updates. Bars that existed already will stay and labels (mouseover titles) will be correct. New bars are always red, while ones that were there before are green. (Based on an example from enjalot.)