The example you provide here has a couple errors.
1. The section %%(d) is missing a % sign inside the parentheses.
2. The part that reads \n\r should be \r\n.
3. The notation works with two arguments only. That is to say, if you attempt to use %d a third time, the result for that third part will be garbage.
This third problem makes it particularly difficult to use this section of the INI file for your purposes. A suggestion has already been entered into our database to allow the use of %d more than two times in the INI file. Refer to tracking number #1985 if you have any questions/comments.
In the meantime, here is a script that should do what you want. Here, count is being used as a substitute for %d.
%Z="";
count=1;
doc -e DY {
%Z=%Z
\L($(count)) %%($(count)) %%($(count),@W);
count++;
}
n1=legend.x;
if(n1==0/0) {
label -s -sa -n legend %Z; // Use legendx to protect it from being destroyed
} else {
legend.text$=%Z;
}
The script could be placed in a file and then executed by clicking a toolbar button. Or, you might try incorporating the script into a file such as Plot.OGS so that it happens automatically for the specified plot type. Simply place the script at the end (but before the return statement) of its associated section (e.g. [Pie]) in Plot.OGS.
- rtoomey