Set gridline and background color

Refer to the following example code to see how to set the gridline and background color of the exported image.