Suggest doing:

this.bgcanvas_.parentNode.removeChild(this.bgcanvas_)

and similarly for the others, so that you don't have to access a member variable of the Dygraph object.