work on grouping data in the barchart