Using HTML5 Canvas to display a bar chart based on user input