alphagov/spotlight — pull request #640 by annapowellsmith (2014-07-08 16:05:16+00:00)
Title: Fix bug in line labels on grouped timeseries

There was a bug in line labels as follows: where the ordering of the line
labels was different from the ordering of the models in the collection,
behaviour on mouseover was unpredictable. The wrong labels and lines
were highlighting.

This was because we were finding the selected model based on index,
not on model ID. When the labels were re-ordered by our label
positioning algorithm, the wrong index was being passed into the
collection's selectItem method.

Fix this to find the model by ID instead, and update tests.

Story: https://www.pivotaltracker.com/s/projects/911874/stories/74028388