generating bar chart as well