Implmented grouping in Stat charts and bug fixes