First, $X$ must be smooth of dimension one: since the local ring of a closed point $p\in X$ and the analytic local ring of $p\in X_{an}$ have the same completion, they have the same dimension and the same quotients by powers of their maximal ideals, so we see that the tangent space is one-dimensional for all closed points in $X$. Next, we may observe that $X$ is connected: if $X$ has multiple connected components, then $X_{an}$ must as well. So if there is an $X$ such that $X_{an}\cong D$, then $X$ must be a connected smooth curve.
Now we'll introduce some outside results. We begin with a result about smooth curves: any connected smooth curve can be expressed as a smooth projective curve of genus $g$ minus $r$ points. We'll also need the comparison theorem on $\pi_1$:
Theorem (Grothendieck). For a pointed algebraic variety $(X,x)$ over $\mathbb{C}$ there is a canonical isomorphism
between the étale fundamental group $\pi_1^{\text{ét}}(X,x)$ and the profinite completion of the topological fundamental group
$\pi_1^{\rm top}(X(\mathbb{C}),x)$.
(This is SGA1, Expose XII, section 5, for instance.) Now we do a little topology: the fundamental group of a genus $g$ surface with $r$ punctures is a free group on $2g+r-1$ generators (you may verify this by drawing a $2g$-gon with edges identified appropriately and then deleting $r$ points in the interior and looking at what happens, for instance). The profinite completion of this group is nontrivial if $2g+r-1>0$, so we must have $g=0$ and $r=0$ or $1$. Clearly $r=0$ cannot happen as $D$ is not compact while $\Bbb P^1_{an}$ is; $r=1$ cannot happen because then we would have $\Bbb C^1$ biholomorphic to $D$, a contradiction to the uniformization theorem.