window.onload = function() {
var ctx = document.getElementById('chart-area').getContext('2d');
window.myDoughnut = new Chart(ctx, config);
};
When window load that time may chart function is not working and error was accrued "can't read property "getcontext" of null.