refactor bar graph view. not yet working properly