There is, as far as I know, no way to compute this, in one step, from the diagram.  But there is a recursive formula that uses only the diagram.  (Acknowledgment:  I learned about this from John Stembridge and looked it up in some notes he shared with me years ago.)  The recursion runs over all subsets of the nodes of the diagram, so it's not efficient, but for specific infinite families, it can run smoothly.  We may as well give Poincaré series rather than just orders.

For a Coxeter system $(W,S)$, let $W(q)=\sum_{w\in W}q^{\ell(w)}$, where $\ell$ is the usual length function relative to words in $S$.
For $J\subseteq S$, let $W_J$ be the standard parabolic subgroup generated by $J$, so that $W_J(w)=\sum_{w\in W_J}q^{\ell(w)}$.

**Theorem** (Steinberg).  
$$\sum_{J\subseteq S}(-1)^J\frac{1}{W_J(q)}=\begin{cases}\frac{q^{\ell(w_0)}}{W(q)}\text{ if }W\text{is finite with longest element }w_0,\\0\text{ if }W\text{ is infinite.}\end{cases}$$

This theorem is supposed to be in Steinberg's monograph *Endomorphisms of linear algebraic groups* (AMS Memoir 80), but I haven't chased that down.  

Of course, setting $q=1$ gives a recursion for your original question, without needing to think about $w_0$.  But also, since $\frac{1}{W(q)}$ has leading term $1$, you can actually find $\ell(w_0)$ from this recursion, so the whole thing depends only on the diagram, and as a bonus, detects finiteness.  And of course, it's useful to remember that if $W$ has a disconnected diagram, the its Poincaré series is the products of the Poincaré series of its components.