We analytically solve the relativistic equation of motion for an electron in ion plasma channels and calculate the corresponding trajectory as well as the synchrotron radiation. The relativistic effect on a trajectory is strong, i.e., many high-order harmonic terms in the trajectory, when the ratio of the initial transverse velocity (vx0) to the longitudinal velocity (vz0) of the electron injected to ion plasma channels is high. Interestingly, these high-order harmonic terms result in a quite broad and intense radiation spectrum, especially at an oblique angle, in contrast to an earlier understanding. As the initial velocity ratio (vx0: vz0) decreases, the relativistic effect becomes weak; only the first and second harmonic terms remain in the transverse and longitudinal trajectories, respectively, which coincides with the result of Esarey [Phys. Rev. E 65, 056505 (2002)]. Our formalism also allows the description of electron's trajectory in the presence of an applied magnetic field. Critical magnetic fields for cyclotron motions are figured out and compared with semiclassical results. The cyclotron motion leads to more high-order harmonic terms than the trajectory without magnetic fields and causes an immensely broad spectrum with vastly large radiation amplitude for high initial velocity ratios (vx0: vz0). The radiation from hard x-ray to gamma-ray regions can be generated with a broad radiation angle, thus available for applications.