BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
scottahindle

Community Trekker

Joined:

May 18, 2017

How to script a copy / paste of a chart for customized use in a new window?

I would like to summarise numerous data sets in control charts and display all the charts nicely on one form (new window) using h list box and v list box functions. Hence some scripting to copy/paste in some way is in mind.

In consolidating so many charts space on the new window starts to get constrained. Hence I would like to not include the top outline box in each chart's display which always has the default title "Control Chart". 

I would, however, like in all cases to preserve the second outline box since it offers me a customised title for each chart.

Attached are examples of the usage of "h list box" that I have in mind.

If it easier to copy and paste frame contents let me know. I could then just use text boxes above each control chart in my consolidation. If this option is best please comment on how to best use copy frame contents and paste frame contents.

The attached pdf may be easier to understand because my aim is shown visually.

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson

Super User

Joined:

Jun 22, 2012

Solution

Re: How to script a copy / paste of a chart for customized use in a new window?

Here is one way to do what you want

Names Default To Here( 1 );

dt = Current Data Table();
cc1 = Control Chart( invisible, Sample Label( :Sample ), Group Size( 1 ), KSigma( 3 ), Chart Col( :Y1, Individual Measurement ) );

cc2 = Control Chart( invisible, Sample Label( :Sample ), Group Size( 1 ), KSigma( 3 ), Chart Col( :Y2, Individual Measurement ) );
cc3 = Control Chart( invisible, Sample Label( :Sample ), Group Size( 1 ), KSigma( 3 ), Chart Col( :Y3, Individual Measurement ) );
		
cc4 = Control Chart( invisible, Sample Label( :Sample ), Group Size( 1 ), KSigma( 3 ), Chart Col( :Y4, Individual Measurement ) );
		
win = New Window( "Test", 

	hlb1 = H List Box(
		
	),
	hlb2 = H List Box(	
		
	)
);

hlb1 << append( Report( cc1 )[Outline Box( 2 )] );
hlb1 << append( Report( cc2 )[Outline Box( 2 )] );
hlb2 << append( Report( cc3 )[Outline Box( 2 )] );
hlb2 << append( Report( cc4 )[Outline Box( 2 )] );
Jim
3 REPLIES 3
txnelson

Super User

Joined:

Jun 22, 2012

Solution

Re: How to script a copy / paste of a chart for customized use in a new window?

Here is one way to do what you want

Names Default To Here( 1 );

dt = Current Data Table();
cc1 = Control Chart( invisible, Sample Label( :Sample ), Group Size( 1 ), KSigma( 3 ), Chart Col( :Y1, Individual Measurement ) );

cc2 = Control Chart( invisible, Sample Label( :Sample ), Group Size( 1 ), KSigma( 3 ), Chart Col( :Y2, Individual Measurement ) );
cc3 = Control Chart( invisible, Sample Label( :Sample ), Group Size( 1 ), KSigma( 3 ), Chart Col( :Y3, Individual Measurement ) );
		
cc4 = Control Chart( invisible, Sample Label( :Sample ), Group Size( 1 ), KSigma( 3 ), Chart Col( :Y4, Individual Measurement ) );
		
win = New Window( "Test", 

	hlb1 = H List Box(
		
	),
	hlb2 = H List Box(	
		
	)
);

hlb1 << append( Report( cc1 )[Outline Box( 2 )] );
hlb1 << append( Report( cc2 )[Outline Box( 2 )] );
hlb2 << append( Report( cc3 )[Outline Box( 2 )] );
hlb2 << append( Report( cc4 )[Outline Box( 2 )] );
Jim
ih

Community Trekker

Joined:

Sep 30, 2016

Re: How to script a copy / paste of a chart for customized use in a new window?

To add to Jim's post:

  1. Line Up Boxes are handy for this sort of thing, and
  2. You can set the page size so they just fit on a piece of paper.
Names Default To Here( 1 );

dt = Current Data Table();
cc1 = Control Chart( invisible, Sample Label( :Sample ), Group Size( 1 ), KSigma( 3 ), Chart Col( :Y1, Individual Measurement ) );
cc2 = Control Chart( invisible, Sample Label( :Sample ), Group Size( 1 ), KSigma( 3 ), Chart Col( :Y2, Individual Measurement ) );
cc3 = Control Chart( invisible, Sample Label( :Sample ), Group Size( 1 ), KSigma( 3 ), Chart Col( :Y3, Individual Measurement ) );
cc4 = Control Chart( invisible, Sample Label( :Sample ), Group Size( 1 ), KSigma( 3 ), Chart Col( :Y4, Individual Measurement ) );
		
win = New Window( "Test", lub = Line Up Box( N Col(2) ) );

lub << append( Report( cc1 )[Outline Box( 2 )] );
lub << append( Report( cc2 )[Outline Box( 2 )] );
lub << append( Report( cc3 )[Outline Box( 2 )] );
lub << append( Report( cc4 )[Outline Box( 2 )] );
lub << append( Report( cc1 )[Outline Box( 2 )] );

win << Set page setup(
    margins( 0.5, 0.5, 0.5, 0.5 ),
    scale( 1.0 ),
    portrait( 0 ),
    paper size( "Letter" )
);

fn = "$TEMP/JMP PDF Example.pdf";
win << Save PDF( fn );
Open( fn );
wait( 10 );
Delete File( fn )
scottahindle

Community Trekker

Joined:

May 18, 2017

Re: How to script a copy / paste of a chart for customized use in a new window?

Thank you for this answer too!