First of all, you may as well assume your diagram is connected, otherwise the order will be the product of the orders of the irreducible components. I'll assume this from now on.

As Nathan Reading mentioned, it is well-known that the order of the Coxeter group $W$ is
$$ \#W = d_1d_2\cdots d_r$$
where $d_1,\ldots,d_r$ are the <a href="https://en.wikipedia.org/wiki/Coxeter_element">degrees</a> of $W$ (see e.g. Humphreys's "Reflection groups and Coxeter groups," Section 3.9). Note we have $d_i = e_i+1$, where $e_1,\ldots,e_r$ are the exponents of $W$. But it is not so clear how to immediately read off the degrees/exponents from the Dynkin diagram.

In the case where $W$ is a Weyl group, there is a different formula for the order of $W$:
$$ \#W = f \cdot r! \cdot a_1\cdots a_r.$$
Here $r$ is the rank of $W$, $f$ is the index of connection, and the $a_i$ are the coefficients expressing the highest root $\theta$ as a sum of simple roots: $\theta = a_1\alpha_1 + \cdots + a_r\alpha_r$. See Section 4.9 of the aforementioned book of Humphreys, or <a href="https://arxiv.org/abs/1202.4015">Lam-Postnikov "Alcoved Polytopes II"</a> for a $q$-analog.

So how can we read this information from the Dynkin diagram? Of course $r$ is just the number of nodes; and $f$ is the determinant of the Coxeter matrix (it is also equal to one plus the number of $a_i$ equal to one). But what about the $a_i$?

To find the $a_i$ we can iteratively compute $\theta$ as follows. We start by setting $\alpha=\alpha_i$ for some simple root $\alpha_i$. As long as the height of $s_{j}(\alpha)$ for some simple reflection $s_j$ is greater than the height of $\alpha$, replace $\alpha$ by $s_{j}(\alpha)$. Note that this can all be easily phrased algorithmically in terms of vectors in $\mathbb{Z}^r$ and rows of the Coxeter matrix, so indeed is easy to implement just from the Dynkin diagram.

Eventually we terminate at some $\alpha$ for which every simple reflection decreases our height. If the Dynkin diagram is simply laced, this $\alpha$ must be the highest root $\theta$ and then we've found the $a_i$. In the non-simply laced case, we either terminate at the highest root (if we started with a long simple root) or the highest short root (if we started at a short simple root). So we either need to make sure we start at a long simple root, or just try starting at every root to find the highest root we can.

Note that there is another description of the $a_i$ in terms of additive functions on the extended Dynkin diagram (+ subadditive functions on the Dynkin diagram). Basically, $(a_0,a_1,\ldots,a_r)$ is the unique primitive additive function on the extended Dynkin diagram (where always $a_0=1$).