added a print legend for the graph