fix the layout issue for graph only mode.