Slightly changed the script to display weight values instead of more:
names default to here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = dt << Graph Builder(
Show Control Panel( 0 ),
Variables( X( :height ), Y( :weight ), Overlay( :sex ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) )
);
fb = Report( gb )[FrameBox( 1 )];
xx = yy = 0;
valuesMatrix = :height << Get Values; //***new*** Get column values for height
fb << addgraphicsscript(//
Mousetrap(
xx = x;
yy = y;
);
V Line( xx );
// at this point you can highlight all the values near xx
For( irow = 1, irow <= N Rows( dt ), irow += 1,
If( Abs( dt:height[irow] - xx ) < 0.5, // big class height step is 1, <.5 selects a single column of weights
Marker( Marker State( 4 ), {dt:height[irow], dt:weight[irow]} )
)
);
valuesRows = char(:weight[loc(valuesMatrix,round(xx))]); //***new*** write to char weight values for all rows of height at position round(xx)
xwidth = X Range();
xmidpoint = X Origin() + xwidth / 2;
If( xx < xmidpoint,
Text( {xx + xwidth / 100, yy}, "height " || Char( Round( xx ) ) || "\!nweight " || valuesRows )////***new*** exchanged "more" with weigth and list of weight values for that location of height
,
Text( right justified, {xx - xwidth / 100, yy}, "height " || Char( Round( xx ) ) || "\!nweight " || valuesRows )
);
//
);
you may even could add sorting the values ascending/descending.
/****NeverStopLearning****/