1👍
✅
Your problem is in here:
$('<canvas id="chart"'+j+' class="chart"></canvas>')
// ^
Replace that with:
$('<canvas id="chart'+j+'" class="chart"></canvas>')
// ^
You closed the id
attribute before j
.