Added test for vertical and horizontal gridline visibility before added
gridline space so space isn't added when gridlines aren't desired