Bar chart legend

I want to display the legend on the columns of bar chart. How to do that ?
Just like this
temp