creating bar chart from data