graphs bugfix ver.2.0 and 1.8 filter function add

Sorry. There is a mistake in my code.
I fixed a bug in this commit. 
also added a filter function also graphs.rb of version 1.8.

Please merge this commit.
Thank you.