Rendering the time labels and grid dynamically