Make sure the order is as follows:
It doesn't work like that. I have a VBox where i put the both of them. When the hidden one is shown it;s not shown over the datagrid instead it occupies space there and the datagrid becomes salles.
try like this. this will work.
<canvas width="800" height=800>
<canvas id=can1 width="100%" height="100%">
<canvas id=can2 width="100%" height="100%" visible=false includeInLayout=false>
can2.visible = can2.includeInLayout = true;