As an alternative, you might consider using 'MarkerSeg'. In the code below 'dt' is a table of all the distinct levels of the column you wish to colour and mark by. You could use 'Tables > Summary' and make this invisible.
NamesDefaultToHere(1);
// Example data table (markers and colors assigned by 'Lot ID')
dt = New Table( "Rows With Colors and Markers",
Add Rows( 12 ),
New Column( "Lot ID",
Character,
"Nominal",
Set Values(
{"lot1", "lot10", "lot11", "lot12", "lot13", "lot2", "lot3", "lot4",
"lot5", "lot6", "lot7", "lot8"}
),
Lock( 1 )
),
Set Row States(
[896.813481688499, 1104.17848521471, 34064.2516910434, 1584.79095828533,
1856.1745531559, 34848.5869575739, 35120.7292968035, 2704.17450988293,
2976.75480300188, 3200.51829791069, 3408.21706777811, 36368.77437675]
)
);
// Make legend window with MarkerSeg
n = NRow(dt);
xx = J(n, 1, 1);
yy = Transpose(1::n);
legendList = Column(dt, "Lot ID") << getValues;
gb = Graph Box(
FrameSize( 150, 300*(n/16) ),
Y Scale( 0, n+1 ),
X Scale( 0, 6 ),
Y Name(" "),
X Name(" "),
Y Axis(ShowLabels(0), ShowMajorTicks(0), ShowMinorTicks(0)),
X Axis(ShowLabels(0), ShowMajorTicks(0), ShowMinorTicks(0)),
Marker Seg( xx, yy, Row States( dt ) ),
For( i = 1, i<=n, i++, Text( {1.5, i-0.1}, legendList[i] ) )
);
db = PanelBox("Row State Colours and Markers for 'Lot ID'", gb);
New Window( "My Legend", db);