Added functionality to switch chart type dynamically.