implemented legends for bar charts