Added legend & barchart data hadling