cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
Abby_Collins14
Level III

How to add subtitles to control chart via scripting?

Does anyone know of a way to add subtitles to control charts via scripting? I would have a column of subtitle names, and would like to loop through that and add row 1 as the subtitle for column 2, row 2 the subtitle for column 3.. ect 

 

Any tips/knowledge if this is possible would be great! Thanks! 

1 REPLY 1
jthi
Super User

Re: How to add subtitles to control chart via scripting?

Not sure if you can set subtitles to Control Chart (Builder), so you might have to create copy of the text edit box which is used as title and then append it with new text box.

 

Below is one example

 

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Quality Control/Coating.jmp");
new_col = dt << New Column("subtitles",  Character, Nominal);
new_col[1] = "text1";
new_col[2] = "text2";

nw = New Window("",
	vlb = V List Box()
);
nw << Show Window(0);

cols_of_interest = {"Weight", "Weight 2"};
subtitles = :subtitles << get values;

For Each({col_of_interest, idx}, cols_of_interest,
	vlb << append(obj = dt << Control Chart Builder(Variables(Y(:Weight), Subgroup(:Sample))));
	title_teb = (Report(obj)[TextEditBox(1)]);
	gb_titlebox = title_teb << parent;
	gb_titlebox << Append(V List Box(align("center"),
		title_teb << Clone box(),
		Text Box(dt[idx, "subtitles"])
	));
	title_teb << Delete Box();
	wait(0);	
);
nw << Show Window(1);

 

 

-Jarmo