Cleaned up code. Changed the behavior of legendLeft and legendTop to specify % of the graph.