Fix chart and legend data not switching correctly.
Fix chart and legend data not switching correctly.

- The chart now unloads previous data when updated.
- The legend elements are now bound by the item name instead of the
  index and are removed as appropriate when the data is changed.

wearefuturegov/opendata,wearefuturegov/opendata,wearefuturegov/opendata