'Collect params related to grid lines.'

def _GetGridParams(self, chart):

    x = 0
    y = 0
    if chart.bottom.grid_spacing:
        assert (chart.bottom.min is not None)
        assert (chart.bottom.max is not None)
        total = float((chart.bottom.max - chart.bottom.min))
        x = ((100 * chart.bottom.grid_spacing) / total)
    if chart.left.grid_spacing:
        assert (chart.left.min is not None)
        assert (chart.left.max is not None)
        total = float((chart.left.max - chart.left.min))
        y = ((100 * chart.left.grid_spacing) / total)
    if (x or y):
        return dict(grid=('%.3g,%.3g,1,0' % (x, y)))
    return {}
