correct window listener for chart directive