Fixed exception after destroying a chart while the tooltip is still visible. Closes #1728.