Closed darren-uk closed 1 year ago
Error when calling displayGraph(). = Canvas is already in use.
Canvas needs to be cleared before redrawing
possible solution at https://stackoverflow.com/questions/40056555/destroy-chart-js-bar-graph-to-redraw-other-graph-in-same-canvas
using .destroy() or const context = canvas.getContext('2d'); context.clearRect(0, 0, canvas.width, canvas.height);
Fixed issue by deleting canvas element from HTML and using function to re create element before populating
Error when calling displayGraph(). = Canvas is already in use.
Canvas needs to be cleared before redrawing
possible solution at https://stackoverflow.com/questions/40056555/destroy-chart-js-bar-graph-to-redraw-other-graph-in-same-canvas
using .destroy() or const context = canvas.getContext('2d'); context.clearRect(0, 0, canvas.width, canvas.height);