Improve chart (re)sizing on some corner cases