Electric Potential Energy

My book first introduces expressions for work and energy by referring to concepts from mechanics and gravitation. It uses the familiar expressions F =mg (-y direction) & U=mgy to explain the expressions it gives for electric potential energy. However... I understand that the force due to gravity in the first couple of expressions is always downward, hence the negative y-direction. But when it gives the expressions for force and potential energy of a point charge, Fy = -q0*E & U = q0*Ey, I don't understsand why they define it with only the y-component. Doesn't it depend on the direction of your electric field? I mean... electric field doesn't always have to be in the y-direction, right?