Comparisons of the undulator radiation spectra from various ideal shapes of the on-axis magnetic field strengths in undulator were made. The computations were performed for the `sinusoidal` shape, the `triangular` shape, the `rectangular` shape and the `power of sinusoidal` shape of magnetic fields. For all cases, 0.3 GeV electron energy, 80 mm magnetic period length and 12 magnetic periods were assumed. The remarkable changes of peak intensities for the third harmonic and the fifth harmonic of undulator radiations were observed. Whereas the fundamental peaks had no remarkable changes. The peak intensities of the 5th harmonics for the triangular and the rectangular shapes of magnetic fields were 1.5 and 0.6 times higher than that for the sinusoidal shape, respectively. Higher peak intensities for higher harmonics of undulator radiation were observed for higher power of sinusoidal shape of magnetic fields. (author).