encapsulated function for populating chart data. Still have to think about whether I need to sort the comparison data...