bar chart 1 added sorting functionality