Subscribe Bookmark RSS Feed

Why am I losing charts when saving in Interactive HTML format?

jpol

Community Trekker

Joined:

Oct 11, 2015

Hi,

I have a need to publish Product Monitors on a daily basis from Final Tester measurement data.

There are many parameters measured on multiple products.

I have succeeded in setting up the monitors in a form that meets my needs but most of them get lost when saved in the Interactive HTML format.

Below are some screen grabs of the issue (limited to one parameter):

When I set up the Control Charts manually I get the following charts.

These are as expected and exactly what I need. 3 products, 1 parameter.

10207_pastedImage_0.png

When I then save these charts as Interactive HTML using the pull-down menus I get a layout pretty much the same as above.

Still 3 products and 1 paramter

So far, so good.....

10211_pastedImage_1.png

However when I try to script this process using:

Set Default Directory("C:\TEMP");

Get Default Directory(); // returns "c:/temp"

cd=get default directory();

obj = Control Chart(

SendToByGroup( {:Product == "AaA"} ),

Sample Label( :Wafer ),

Group Size( 1 ),

KSigma( 3 ),

Chart Col( :Avg. of A_PRIM, Individual Measurement ),

By( :Product ),

{:Product == "AaA"},

{"Control Chart Product=AaA",

"Individual Measurement of Avg. of A_PRIM"},

"IR Chart of IM",

FrameBox,

{Frame Size( 313, 100 )}

),

{"Control Chart Product=AaA",

"Individual Measurement of Avg. of A_PRIM"},

"IR Chart of IM",

FrameBox( 2 ),

{Frame Size( 313, 100 )}

),

{:Product == "BbB"},

{"Control Chart Product=BbB",

"Individual Measurement of Avg. of A_PRIM"},

"IR Chart of IM",

FrameBox,

{Frame Size( 313, 100 )}

),

{"Control Chart Product=BbB",

"Individual Measurement of Avg. of A_PRIM"},

"IR Chart of IM",

FrameBox( 2 ),

{Frame Size( 313, 100 )}

),

{:Product == "CcC"},

{"Control Chart Product=CcC",

"Individual Measurement of Avg. of A_PRIM"},

"IR Chart of IM",

FrameBox,

{Frame Size( 313, 100 )}

),

{"Control Chart Product=CcC",

"Individual Measurement of Avg. of A_PRIM"},

"IR Chart of IM",

FrameBox( 2 ),

{Frame Size( 313, 100 )}

);

 

obj <<Save Interactive HTML("Product Probe Monitortest.html" );

Open("Product Probe Monitortest.html" );

I get:

Only 1 product and 1 parameter.

10212_pastedImage_2.png

As may be seen Products 'AaA' and 'BbB' are missing.

How should I change the script to have them included?

In practice, I will set up these monitors for 10's of products, each having from 50 to 200 test parameters so any hints here would be much appreciated.

Many thanks,

Philip

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

If you look at what obj contains, it has a list of control charts (the three control charts from your example): {Control Chart[], Control Chart[], Control Chart[]}

When you send a message (like Save Interactive HTML) to a list, the message is sent to each member of the list in turn. So what is happening here is that first it saves an html page with the first control chart, then it save a second html page with the same name that contains the second control chart, and then it saves a third html page with the same name that contains the third control chart. The end results is an html page that contains only the third control chart.

The solution is to send the Save Interactive HTML message to a single container farther up the tree that contains all the control charts.

To do this, replace this line in your code:

obj <<Save Interactive HTML("Probe_Monitor.html" );

With these two lines:

tp = obj[1] << topparent();

tp <<Save Interactive HTML("Probe_Monitor.html" );

HTH

6 REPLIES
msharp

Super User

Joined:

Jul 28, 2015

This can't be your code.  It's broken as posted.  For example, obj = ( .. ) only encompasses AaA product information, and somehow you only get CcC product information in your html?  There's an extra ")" at the end.  Next, there's no data set.

Please post working code using a sample data set. For example; dt = open("$Sample_Data\Big Class.jmp").  Or attach the sample data set you are using above.  It's hard to fix your specific issue when there's a host of other issues that have to be dealt with first.

jpol

Community Trekker

Joined:

Oct 11, 2015

Hi msharp,

Thank you for your feedback.

As you can see I am no scripting expert and appreciate your input.

Please see below the code used:

Set Default Directory("C:\TEMP");  // Use C:TEMP during testing phase only

Get Default Directory();

 

cd=get default directory();

 

dt = open("Split Data.jmp");

 

column(1) << label(1);

column(3) << label(1);

column(5) << label(1);

column(6) << label(1);

dt = Current Data Table();

 

obj = Control Chart(

Sample Label( :DISCNR ),

Group Size( 1 ),

KSigma( 3 ),

Chart Col( :Avg. of A_PRIM, Individual Measurement ),

By( :SENSORTYPENR )

);

 

obj <<Save Interactive HTML("Probe_Monitor.html" );

Open("Probe_Monitor.html" );

Please find attached the data table and script

- Philip

Solution

If you look at what obj contains, it has a list of control charts (the three control charts from your example): {Control Chart[], Control Chart[], Control Chart[]}

When you send a message (like Save Interactive HTML) to a list, the message is sent to each member of the list in turn. So what is happening here is that first it saves an html page with the first control chart, then it save a second html page with the same name that contains the second control chart, and then it saves a third html page with the same name that contains the third control chart. The end results is an html page that contains only the third control chart.

The solution is to send the Save Interactive HTML message to a single container farther up the tree that contains all the control charts.

To do this, replace this line in your code:

obj <<Save Interactive HTML("Probe_Monitor.html" );

With these two lines:

tp = obj[1] << topparent();

tp <<Save Interactive HTML("Probe_Monitor.html" );

HTH

jpol

Community Trekker

Joined:

Oct 11, 2015

Hi melaniedrake,

Thank you for the solution and in particular for pointing out the error in my code.

I have made the changes you suggested and it works very well.

It helps a lot.

Best Regards,

Philip

msharp

Super User

Joined:

Jul 28, 2015

melaniedrake is correct.  For greater control, you can use the 'New Window("title") << Append(obj)' format.  See below.

// Test script to automate new product Final Test monitoring

Set Default Directory("C:\TEMP");  // Use C:TEMP during testing phase only

Get Default Directory();

cd=get default directory();

dt = open("Split Data.jmp");

column(1) << label(1);

column(3) << label(1);

column(5) << label(1);

column(6) << label(1);

dt = Current Data Table();

theWindow = New Window("Control Charts");

theWindow << Append(obj = Control Chart(

  Sample Label( :DISCNR ),

  Group Size( 1 ),

  KSigma( 3 ),

  Chart Col( :Avg. of   A_PRIM, Individual Measurement ),

  By( :SENSORTYPENR )

));

theWindow <<Save Interactive HTML("Probe_Monitor.html" );

//wait(0);

Open("Probe_Monitor.html" );

jpol

Community Trekker

Joined:

Oct 11, 2015

Hi msharp,

Thank you for the confirmation of melaniedrake's proposed solution and also for offering an alternative solution which I will also evaluate.

Best regards,

Philip