Increment slider bar

I am trying to create a graphical slider bar made of 10 vertical rectangles. As the users slides the slider, the bars change color and a counter moves from 1 to 10. Does anyone know how I could accomplish this?

Thank you for any help you may have.