  We perform a study of the $X(3872)$ lineshape using the data samples of
$e^+e^-\to\gamma X(3872)$, $X(3872)\to D^0\bar{D}^0 \pi^0$ and $\pi^+\pi^-
J/\psi$ collected with the BESIII detector. The effects of the coupled-channels
and the off-shell $D^{*0}$ are included in the parameterization of the
lineshape. The lineshape mass parameter is obtained to be $M_{X}=(3871.63\pm
0.13^{+0.06}_{-0.05})$ MeV. Two poles are found on the first and second Riemann
sheets corresponding to the $D^{*0}\bar{D}^0$ branch cut. The pole location on
the first sheet is much closer to the $D^{*0}\bar{D}^0$ threshold than the
other, and is determined to be $7.04\pm0.15^{+0.07}_{-0.08}$ MeV above the
$D^0\bar{D}^0\pi^0$ threshold with an imaginary part
$-0.19\pm0.08^{+0.14}_{-0.19}$ MeV.
