Updated to watch chartType, resize correctly when hidden.