chart.js - Canvas remembers previuos images -


i'm new on using canvas. need display charts generated charts.js.
have 4 buttons on page select chart show.
fine, when switch different chart (regularly displayed) , move cursor on canvas flips 1 of previous images rendered.

i wrote function clear canvas, is:

function clearcanvas() { var ctx = document.getelementbyid("show"); var context = ctx.getcontext('2d'); context.clearrect(0, 0, ctx.width, ctx.height); } 

this function called before draw new chart. added button manually clear charts. works (the area blanked), but, again, hovering area show charts.
possibly there other methods should use have canvas forgot previous drawing.

i found similar question (canvas not clear) without resolutive answer.

i use firefox 52.xx , charts.js @ last version (2.5 think)


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -