Fastgraphs uses a "formula" for figuring the P/E, that's the small rectangular window on the right side of the graph that specifies: "GDF...P/E=G 15.0" GDF stands for Graham/Dodd Formula, if I remember correctly. With some research of fastgraphs, you can find the article where they explain how they calculate P/E. There are two different formulas they use I think, depending on the companies growth rates.
Edit: Found it: http://www.fastgraphs.com/pdf/EarningsCalculations.pdf
Edit: Found it: http://www.fastgraphs.com/pdf/EarningsCalculations.pdf