BookmarkSubscribeRSS Feed
Tom_P

New Contributor

Joined:

Feb 9, 2018

How to Add Row Legend to Control Chart Report & Hide Data Table

 Hello,

 

Once i've created a control chart script, how do i:

1) Add a Row Legend to the PLOTS window based on TOOL?

2) Hide the data table, but keep the PLOTS screen visible?


 

dt = Open Database( "Database1",
"SELECT
           MEAS1,
           TEST_DATE,
           TOOL
FROM Data_Table_1
where  Test_Date > sysdate - 365
            order by test_date asc
",
"dt"
);

dt << Color by Column( :TOOL, Color Theme( "JMP Dark" ) );

New Window( "PLOTS",
V List Box(
dt << Control Chart(
Marker Size( 4 ),
Sample Label( :TEST_DATE ),
Group Size( 1 ),
KSigma( 3 ),
Chart Col(
:MEAS1, Individual Measurement( Show Zones( 3 ), Shade Zones( 1 ), Sigma( 1.73e+17 ), Avg( 1.20e+18 ), LCL( 6.77e+17 ), UCL( 1.73e+18 ) )
))));

Try( dt << Close Window );

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson

Super User

Joined:

Jun 22, 2012

Solution

Re: How to Add Row Legend to Control Chart Report & Hide Data Table

Below is a corrected script.  The corrections are documented in the Scripting Index

     Help==>Scripting Index

dt = Open Database(
	"Database1",
	"SELECT
           MEAS1,
           TEST_DATE,
           TOOL
FROM Data_Table_1
where  Test_Date > sysdate - 365
            order by test_date asc
",
	"dt"
);


dt << Color by Column( :sex, Color Theme( "JMP Dark" ) );

New Window( "PLOTS",
	V List Box(
		cc = dt << Control Chart(
			Marker Size( 4 ),
			Sample Label( :TEST_DATE ),
			Group Size( 1 ),
			KSigma( 3 ),
			Chart Col(
				:MEAS1,
				Individual Measurement(
					Show Zones( 3 ),
					Shade Zones( 1 ),
					Sigma( 1.73e+17 ),
					Avg( 1.20e+18 ),
					LCL( 6.77e+17 ),
					UCL( 1.73e+18 )
				)
			)
		)
	)
);
report(cc)[framebox(1)]<< row legend("TOOL");
dt<<show window(0);
Jim
2 REPLIES
txnelson

Super User

Joined:

Jun 22, 2012

Solution

Re: How to Add Row Legend to Control Chart Report & Hide Data Table

Below is a corrected script.  The corrections are documented in the Scripting Index

     Help==>Scripting Index

dt = Open Database(
	"Database1",
	"SELECT
           MEAS1,
           TEST_DATE,
           TOOL
FROM Data_Table_1
where  Test_Date > sysdate - 365
            order by test_date asc
",
	"dt"
);


dt << Color by Column( :sex, Color Theme( "JMP Dark" ) );

New Window( "PLOTS",
	V List Box(
		cc = dt << Control Chart(
			Marker Size( 4 ),
			Sample Label( :TEST_DATE ),
			Group Size( 1 ),
			KSigma( 3 ),
			Chart Col(
				:MEAS1,
				Individual Measurement(
					Show Zones( 3 ),
					Shade Zones( 1 ),
					Sigma( 1.73e+17 ),
					Avg( 1.20e+18 ),
					LCL( 6.77e+17 ),
					UCL( 1.73e+18 )
				)
			)
		)
	)
);
report(cc)[framebox(1)]<< row legend("TOOL");
dt<<show window(0);
Jim
Tom_P

New Contributor

Joined:

Feb 9, 2018

Re: How to Add Row Legend to Control Chart Report & Hide Data Table

Awesome!

Thanks a lot!