0👍
✅
Using the DOM by clearing the parent element of the chart’s canvas element, and when recreating the canvas element, assigning it the id of chart
as needed in the variable of ctx
, and when appending that to the parent element of the former canvas element works indeed. All in the graphing
function, and when simply calling the graphing function where need be.
Source:stackexchange.com