cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to use Accelerated Life Testing (ALT) to evaluate reliability. Register for June 5 webinar, 2pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Clanlope
Level III

[Graph builder] Batch pin the hover label for selected rows

Dear all,

Currently I use JMP16 to create a graph.

I have a col with picture in it, and I want to pin the picture for each dot I selected so I turn on the "add label" of this col.

But I find that I can only by hover my pointer on the dot, and wait the hover label shown itself, and then click the pin button to pin it one by one,

is there any faster way to achieve this like jsl code?  I have million of rows need to show out the pics.

thanks!

2 REPLIES 2

Re: [Graph builder] Batch pin the hover label for selected rows

Does it need to be a hover label? Or could you use the picture as the symbol in your graph? For example, using the Big Class Families sample dataset: 

christianz_0-1780651419584.png

If you only want pictures for selected rows, you could select them and Name Selection in Column, then use that Column to create a Transform column, like this: 

// Open Data Table: Big Class Families.jmp
// → Data Table( "Big Class Families" )
Open( "$SAMPLE_DATA/Big Class Families.jmp" );

// Name selection in column: Use Images
Data Table( "Big Class Families" ) << Clear Select <<
Select Rows( [1, 6, 14, 15, 16] ) <<
Name Selection in Column( Column Name( "Use Images" ), Selected( 1 ) );

Graph Builder(
	Transform Column( "Transform[height]", Formula( :height * :Use Images ) ),
	Size( 648, 551 ),
	Show Control Panel( 0 ),
	Variables(
		X( :weight ),
		Y( :height ),
		Y( :"Transform[height]"n, Position( 1 ) )
	),
	Elements(
		Points( X, Y( 1 ), Y( 2 ), Legend( 3 ) ),
		Points( X, Y( 2 ), Legend( 5 ), Set Shape Column( :picture ) )
	)
);
christianz_0-1780654730474.png

 

I included the script so you can see the results with one click, but this can all be done within Graph Builder with no scripting. The key functionalities are Transform Columns and Set Shape Column

mmarchandFSLR
Level VI

Re: [Graph builder] Batch pin the hover label for selected rows

Here's an example pinning the hover labels.  Interesting that the selection is zero-based indexing.  May want to modify to handle no rows selected.

 

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class Families.jmp" );

dt << Select Rows( [1 5 7] );

pin_expr = {};
For Each( {v, i}, dt << Get Selected Rows,
	Insert Into(
		pin_expr,
		Eval(
			Eval Expr(
				{Add Pin Annotation(
					Seg( Marker Seg( 1 ) ),
					Index( Expr( v - 1 ) ),
					Index Row( Expr( v - 1 ) ),
					UniqueID( Expr( v - 1 ) )
				)}
			)
		)
	)
);

Eval(
	Substitute(
			Expr(
				dt << Graph Builder(
					Size( 658, 556 ),
					Show Control Panel( 0 ),
					Variables( X( :weight ), Y( :height ) ),
					Elements( Points( X, Y, Legend( 5 ) ) ),
					SendToReport( Dispatch( {}, "Graph Builder", FrameBox, __pin_expr__ ) )
				)
			),
		Expr( __pin_expr__ ), Name Expr( pin_expr )
	)
);

mmarchandFSLR_0-1780659051670.png

 

Recommended Articles