All you have to do is to add the By clause into the JSL code
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\semiconductor capability.jmp" );
Graph Builder(
Variables( X( :PNP1 ), Y( :NPN1 ) ),
Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) ),
by( :site )
);
Jim