Fixed bug where the width and height of chart weren't updated