Unify some redundant D3 graph functions

This commit unifies all line graph generating functions into one
standard function. Tool tip generating functions are also now
unified.