Interactively, you add a legend using the Row Legend command. To accomplish this through JSL, send a Row Legend message to the display. In this message, specify which column you want to base the legend on, and whether the legend should affect colors and markers.
For example, using Big Class, submit the following JSL to turn on a legend based on the age column, setting both colors and markers by values in the age column.
The color() and marker() arguments are optional. By default, they mimic the behavior of the window: colors are on by default, and markers are off.
To use a continuous scale if your variable is nominal or ordinal, use the Continuous Scale(1) option with the color(1) option.