TypeError: Cannot read property currentStyle 'null in chart.js
I am trying to update a pie chart (using Chart.js) every time an input field changes. I do this by replacing the existing graph with a blank canvas and then redrawing it. This works, but causing me to get "TypeError: Can not read property" currentStyle "null".
The code is below,
function drawSummaryPie() {
$('#myChart').replaceWith('<canvas id="myChart" width="200" height="200"></canvas>');
draw();
}[enter image description here][1]
and any help would be appreciated!
+3
source to share
1 answer