Desperetly need help with rotating an object to face the direction of the joystick

I really need help on making the object rotate to the position of the joystick. How would I do that?

Getting the z axis and setting a quaternion: Quaternion rotation = Quaternion.Euler(0, Input.GetAxis("Joy Z Axis"), 0);

Setting the rotation to the quaternion: transform.rotation = rotation;

And to add the Z Axis Input: