Line Color Gradients

I have two vertical lines - I want to apply a gradient vertically…that is a gradient that starts one color near the top of the lines and goes to a different color at the bottom of the lines. It appears right now that the gradient is being applied horizontally (obviously doing nothing for vertical lines). How can I redirect the gradient vertically?

If it were a rectangle I could use the paint bucket tool to change the gradient direction but I’d like to keep the lines as lines…and therefore I cannot apply the use of the paint bucket tool. Thanks.