I've also been having trouble finding the script to produce my desired legend.
I have defined a loop which calls data into a worksheet then plots it onto one graph. With every run of the loop and graphing of the data, I'd like to add a line to the legend text box "key".
I can easily produce the legend for the first data set with:
label -s -sa -n Key \l(($(i)) d=%J \r\n;
where "i" is the loop counting variable and corresponds to the number of the data set and %J a parameter for each data set which the user imputs in a promt at the beginning of each run of the loop.
The problem is I can't make a second line in the same textbox on the second run of the loop because by using the "label" command again I simply copy over, and not add too, what already is in the text box.
I've tried using the "Key.addText(\l(($(i)) d=%J )" command after the initial label command but I can't use "\r\n" with the "addText" command.
Is there a way to incorporate "\r\n" in the "Key.addText(StringVariable) command?