bar chart working with custom object data