cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
Clanlope
New Member

[JMP12 JSL for Graph Builder] Failed to add new element into each position

Hi, currently I hope to add new element into each position for my chart, chart with one X-axis and several Y-axes;

 

so I use the code below:

 

For(jj = 1, jj <= 20, jj++,

gb << Elements( Position( 1, jj ), Points( X, Y , Legend( 1 )), Smoother( X, Y , Legend( 2 ) ) );

);

 

However, the chart created with this code still with 1 elements only, I right click the chart there are 2 elements shown though.

When I perform redo analyse, the new chart created as expected but I don't know why.

 

Since I am now using JMP12, is it caused by the dated version?

3 REPLIES 3
jthi
Super User

Re: [JMP12 JSL for Graph Builder] Failed to add new element into each position

I don't have access to JMP12 to test this, but it might be enough if you evaluate jj

Eval(
	EvalExpr(
		gb << Elements(Position(1, Expr(jj)), Points(X, Y, Legend(1)), Smoother(X, Y, Legend(2)))
	)
);
-Jarmo
txnelson
Super User

Re: [JMP12 JSL for Graph Builder] Failed to add new element into each position

I tested the JSL under JMP 12.2 and in order to get the Legend to appear correctly I needed to make a minor change.

txnelson_0-1728300074995.png

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
dt << New Column( "Ratio", formula( :Height / :Weight ) );
gb = Graph Builder( Variables( X( :age ), Y( :height ), Y( :weight ), Y( :ratio ) ) );
For( jj = 1, jj <= 20, jj++,
	Eval(
		Eval Expr(
			gb << Elements(
				Position( 1, Expr( jj ) ),
				Points( X, Y, Legend( Expr( jj * 2 ) ) ),
				Smoother( X, Y, Legend( Expr( jj * 2 + 1 ) ) )
			)
		)
	)
);
Jim
hogi
Level XII

Re: [JMP12 JSL for Graph Builder] Failed to add new element into each position

and for later versions of JMP?