refactor chart autoresize for longer chart icon