Hi Anuj,
Have you used update chart/grid(true) command? I don't see it being used.
Try running it with iGrid with height and width set to 0. This would be a work around, if it works you will have to check if iCommand class has some problem.
Thanks,
Swaroop