Charts and data for charts

Added charts and logic for generating data for charts and changed logic for
selecting measurement so that the aggregated measurement is used.