14. In the Cartesian coordinate system, there is a square with vertices at $A(-1,-1)$, $B(1$, $-1)$, $C(1,1)$, and $D(-1,1)$. Let the area of the part of the square above the broken line $y=|x-a|+a$ be $S$. Try to find the functional relationship of $S$ with respect to $a$, and draw the graph of $S$.
14. (1) When $a \geqslant 1$, the graph of $y=|x-a|+a$ has no common parts with the square $A B C D$, so $S=0$.
(2) When $0 \leqslant a \leqslant 1$,
$$
S=\frac{1}{2} \times(1-a) \times 2(1-a)=(1-a)^{2} .
$$
(3) When $-1 \leqslant a<0$,
$$
S=2-\frac{2(1-|a|)(1-|a|)}{2}=2-(1+a)^{2} \text {. }
$$
(4) When $a<-1$, $S=2$.

Therefore, the function relationship between $S$ and $a$ is
$$
S=\left\{\begin{array}{ll}
0, & a \geqslant 1, \\
(1-a)^{2}, & 0 \leqslant a<1, \\
2-(1+a)^{2}, & -1 \leqslant a<0, \\
2, & a<-1 .
\end{array}\right.
$$

The graph is shown in Figure 7.