For a flush draw you take your number of outs and divide by the number of cards unknown.
On the flop you have 9 (13 - 4) cards that help your flush. There are 47 (52 - 3 flop cards - 2 hole cards) cards that could be dealt. So you're 9/47 to hit your flush on the turn. If you miss your flush on the turn there are still 9 cards that help but 46 unknown cards - so 9/46 to hit on the river.
To combine that all 9/47 + (38/47 * 9/46) = 34.967%.
But this assumes you saw both the turn and the river - our luck graph does not assume that. If you saw the turn and there was no river we still take that hand into account - which is why we use the method we do.
A complete list of odds for completion of various draws is available
here (among other places, google just dropped me there first), but I thought you might like to know how these numbers were achieved not just what they were
You can figure out the straight draw options by looking for either 4 or 8 outs depending on the type of straight draw you've got.