restructuring bar_chart to be more re-useabel; added function t fetch all types and group them in categories; added functions to display type-bar-chart