Sort values by the x-coordinate