Added a aggregating logic to get line charts