1👍
✅
You are using the variable ctx
which is indeed not defined.
Change this line:
document.getElementById('productDetailGraph').getContext('2d');
To this:
var ctx = document.getElementById('productDetailGraph').getContext('2d');
Source:stackexchange.com