Updated function for new horizontal bar chart