refactor horizontal bar chart