Adding legend to the graph