added logic to rotate between the line chart and bar charts