cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

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

[Graph Builder Legend] How to batch rename all the legend items label by JSL

Hi all,

I create a graph builder with legend, and all legend items starts with Mean(x1) Mean(x2) Mean(x3)...

is it able to batch change all the legend label to just x1, x2, x3 ...

I tried this way but didn't work.

Thanks!

server = gb << Get Legend Server;
items = server << Get Legend Items;
For( i = 1, i <= N Items( items[1] ), i++,
	legendmodelitem = items[1][i];
	thelabel= legendmodelitem << get properties(); << get text()?
);
1 REPLY 1
jthi
Super User

Re: [Graph Builder Legend] How to batch rename all the legend items label by JSL

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");


gb = dt << Graph Builder(
	Size(664, 550),
	Show Control Panel(0),
	Variables(
		X(:SITE),
		Y(:NPN1),
		Y(:PNP1, Position(1)),
		Y(:PNP2, Position(1)),
		Y(:NPN2, Position(1))
	),
	Elements(
		Points(X, Y(1), Y(2), Y(3), Y(4), Legend(5), Summary Statistic("Mean"))
	)
);

server = gb << Get Legend Server;
items = server << Get Legend Items;
For Each({item, index}, items[1],
	l = item << get label;
	newl = Word(-1, l, "()"); // your logic here
	item << Set Label(newl);
);

Write();
-Jarmo

Recommended Articles