I\'m using Chartjs to display a Line Chart and this works fine:
// get line chart canvas
var targetCanvas = document.getElementById(\'chartCanvas\').getConte
For me this worked:
var in_canvas = document.getElementById('chart_holder');
//remove canvas if present
while (in_canvas.hasChildNodes()) {
in_canvas.removeChild(in_canvas.lastChild);
}
//insert canvas
var newDiv = document.createElement('canvas');
in_canvas.appendChild(newDiv);
newDiv.id = "myChart";