gave user ability to switch between bar chart and pie chart