Can you please elaburate littile bit like what you are going to achieve? Which technology you are using? So we can give you a better solution 

Refer for more info
1) https://github.com/chartjs/Chart.js/issues/3930
2) https://stackoverflow.com/questions/22492485/javascript-error-cannot-read-property-parentnode-of-null/22492596