Adjusting the scale of charts dynamically