Numerous studies of integrated starlight, stellar counts, and kinematics have confirmed that the Milky Way is a barred galaxy. However, far fewer studies have investigated the bars stellar population properties, which carry valuable independent information regarding the bars formation history. Here we conduct a detailed analysis of chemical abundance distributions ([Fe/H] and [Mg/Fe]) in the on-bar and off-bar regions to study the azimuthal variation of star formation history (SFH) in the inner Galaxy. We find that the on-bar and off-bar stars at Galactocentric radii 3 $< r_{rm GC}<$ 5 kpc have remarkably consistent [Fe/H] and [Mg/Fe] distribution functions and [Mg/Fe]--[Fe/H] relation, suggesting a common SFH shared by the long bar and the disc. In contrast, the bar and disc at smaller radii (2 $< r_{rm GC} <$ 3 kpc) show noticeable differences, with relatively more very metal-rich ([Fe/H]~0.4) stars but fewer solar abundance stars in the bar. Given the three-phase star formation history proposed for the inner Galaxy in Lian et al. (2020b), these differences could be explained by the off-bar disc having experienced either a faster early quenching process or recent metal-poor gas accretion. Vertical variations of the abundance distributions at small $r_{rm GC}$ suggest a wider vertical distribution of low-$alpha$ stars in the bar, which may serve as chemical evidence for vertical heating through the bar buckling process. The lack of such vertical variations outside the bulge may then suggest a lack of vertical heating in the long bar.