The question may seem a Convex quadratic minimization with linear constraints:
$$\begin{align}\mathrm{minimize}&\; \sum_\limits{i=1}^n{(x_i-a_i)^2}\\\mathrm{subject\;to}&\; x_{i+1}-x_i>h,\;i=1,2,\cdots,n-1\end{align}$$
there, $a_i$ is known data in your "list", $x_i$ is the appropriate position of label $a_i$.
It's easy to solve $x_i$ with the function "FindArgMin" in Mathematica.
But I can't find out a self-adaption font-size in the function "Style".

(*define function: join line*)
line[pLeft_, pRight_] :=
With[{meanX = Mean[{pLeft[[1]], pRight[[1]]}]},
BezierCurve[{pLeft, {meanX, pLeft[[2]]}, {meanX, pRight[[2]]},
pRight}]];
(*define function: show label*)
showLabel[yData_, label_, labelH_, labelS_, imageHeight_, left_ : 0,
right_ : 100] := Block[{
n = Length[yData],
y = Sort[yData],
vX, ySolve, minmax, scale, object, condition
},
(*solve appropriate position*)
vX = ToExpression["x" <> ToString[#] & /@ Range[n]];
object = Total[(vX - y)^2];
condition = And @@ (# > labelH + labelS & /@ Differences[vX]);
ySolve = FindArgMin[{object, condition}, vX];
(*sacle*)
minmax = MinMax[Flatten[{y, ySolve}]];
scale = imageHeight/Differences[minmax][[1]];
(*Show*)
Graphics[{
{(*right vertical line*)
Opacity[0.5], AbsoluteThickness[1], Gray,
Line[{{right, minmax[[1]]}, {right, minmax[[2]]}}]},
{(*join line*)
Opacity[0.5], AbsoluteThickness[1], Gray,
Table[line[{left, ySolve[[k]]}, {right, y[[k]]}], {k, n}]},
{(*right data point*)
RGBColor["#1d3557"], AbsolutePointSize[3],
Point[{right, #} & /@ y]},
{(*decorate point*)
White, AbsolutePointSize[4], Point[{left, #} & /@ ySolve]},
{(*label*)
RGBColor["#457b9d"],
Table[Inset[
Framed[Style[label[[k]], 8], RoundingRadius -> 2,
FrameMargins -> Tiny, ImageSize -> {Automatic, scale labelH},
Background -> RGBColor["#f1faee"]], {left, ySolve[[k]]},
Right], {k, n}]}
},
ImageSize -> {Automatic, imageHeight},
PlotRange -> {Automatic, minmax + {-labelH, labelH}}]
];
(*Demo*)
y = Sort[RandomReal[{0, 1000}, 15]];
showLabel[y, y, 30, 5, 500, 0, 100]
The code and image for your data:
list = {{1368, 1398}, {1399, 1402}, {1403, 1424}, {1424, 1425}, {1426,
1435}, {1436, 1449}, {1450, 1457}, {1457, 1464}, {1465,
1487}, {1488, 1505}, {1506, 1521}, {1522, 1566}, {1567,
1572}, {1573, 1620}, {1620, 1620}, {1621, 1627}, {1628, 1644}};
y = Sort[list[[;; , 1]]];
showLabel[y, y, 12, 3, 400, 0, 30]
