Fixes the removeEventListner is undefined when chart is rendered again and the previous chart contained no data.