Logitech F310 Controller isn't mapping correctly

Use jstest-gtk to map the right analog stick to the correct axes. In the mapping window drag Axis 2: ABS_RX and Axis 3: ABS_RZ above Axis 4:ABS_Z (really left trigger).

Your final configuration should look like this: enter image description here

Saving this profile would give you ~/.config/jstest-gtk/profile1.xml

<?xml version="1.0"?>
<joysticks>
  <joystick>
    <name>Logitech Gamepad F310</name>
    <device>/dev/input/js0</device>
    <calibration>
      <axis>
        <calibrate>1</calibrate>
        <center-min>-128</center-min>
        <center-max>128</center-max>
        <range-min>-32639</range-min>
        <range-max>32639</range-max>
        <invert>0</invert>
      </axis>
      <axis>
        <calibrate>1</calibrate>
        <center-min>-128</center-min>
        <center-max>128</center-max>
        <range-min>-32639</range-min>
        <range-max>32639</range-max>
        <invert>0</invert>
      </axis>
      <axis>
        <calibrate>1</calibrate>
        <center-min>-128</center-min>
        <center-max>128</center-max>
        <range-min>-32639</range-min>
        <range-max>32639</range-max>
        <invert>0</invert>
      </axis>
      <axis>
        <calibrate>1</calibrate>
        <center-min>-128</center-min>
        <center-max>128</center-max>
        <range-min>-32639</range-min>
        <range-max>32639</range-max>
        <invert>0</invert>
      </axis>
      <axis>
        <calibrate>1</calibrate>
        <center-min>127</center-min>
        <center-max>127</center-max>
        <range-min>0</range-min>
        <range-max>254</range-max>
        <invert>0</invert>
      </axis>
      <axis>
        <calibrate>1</calibrate>
        <center-min>127</center-min>
        <center-max>127</center-max>
        <range-min>0</range-min>
        <range-max>254</range-max>
        <invert>0</invert>
      </axis>
      <axis>
        <calibrate>1</calibrate>
        <center-min>0</center-min>
        <center-max>0</center-max>
        <range-min>-1</range-min>
        <range-max>1</range-max>
        <invert>0</invert>
      </axis>
      <axis>
        <calibrate>1</calibrate>
        <center-min>0</center-min>
        <center-max>0</center-max>
        <range-min>-1</range-min>
        <range-max>1</range-max>
        <invert>0</invert>
      </axis>
    </calibration>
    <axis-map>
      <axis>ABS_X</axis>
      <axis>ABS_Y</axis>
      <axis>ABS_RX</axis>
      <axis>ABS_RY</axis>
      <axis>ABS_Z</axis>
      <axis>ABS_RZ</axis>
      <axis>ABS_HAT0X</axis>
      <axis>ABS_HAT0Y</axis>
    </axis-map>
    <button-map>
      <button>BTN_A</button>
      <button>BTN_B</button>
      <button>BTN_X</button>
      <button>BTN_Y</button>
      <button>BTN_TL</button>
      <button>BTN_TR</button>
      <button>BTN_SELECT</button>
      <button>BTN_START</button>
      <button>BTN_MODE</button>
      <button>BTN_THUMBL</button>
      <button>BTN_THUMBR</button>
    </button-map>
  </joystick>
</joysticks>

I'm having a similar problem and I tried what was suggested but I still have the same problem. My right analog stick will not work for looking up/down, only left/right. I've tried countless suggestions and nothing's worked so far.