Once the graph is printed you can use all the other graphics commands (like DrawText, line, rect) to draw on top of the graph. You can use the GraphArea command to reserve extra area to print the legend.
One possibility is to print the legend under the graph area before you execute the GraphXY command. Let me know how this works out for you. I really haven't had much feedback on the data graphing commands.