fixing bar order in charts, adding onclick binding on bar chart