Why graph is getting blank after dragged it

When I’m dragging(expanding) multiple times then graphs coming blank. I referred this code
I want to stop it. I don’t want blank. I didn’t get how to stop it. Before dragging graph like this:

After dragging multiple times graph coming like following:

My code is:

I can’t replicate. Can you try capturing your screen and posting a gif to help us debug?

when I’m dragging/ expanding graph again and again then last time getting blank graph.

when i’m dragging like this multiple times then last time getting graph blank