code for a bar chart added