stores data in an object and prints a bar graph