In the first picture, the periodic function you approximate has a jump at the end of the interval. Look for Gibbs phenomenon to get a name for the oscillations of the Fourier sums at a jump.
In the second, the first half of the approximation seems suspect. The Fourier sums should be as symmetric as the function is. Since the function is continuous and has only two kinks, convergence should be uniform.