Choose Language Hide Translation Bar
Highlighted
LBrian
Level II

Why can't create a histogram?

Hi everyone.

 

I wanna make a histogram using JSL.

 

 

1)

Names Default To Here( 1 );
dt = Open( "$Sample_Data/Big Class.jmp" );
dt = Current Data Table();

Input = New Window( "example", << modal(),
	new1 = hlistbox(
		Text Box( "Test name :" ),
		Para_Num_teb = Text Edit Box( "", <<set width( 200 ) )
	),
		text box("Click OK"),
		Button Box( "OK", 
		Para_Num = Para_Num_teb << get text();
		),
);
Histogram = Distribution(
	Continuous Distribution(
		column( column(dt, Para_Num )),
		Vertical( 0 ) ,
	  )
);	  	

It can be run normally.

 

2)

Names Default To Here( 1 );
dt = Open( "$Sample_Data/Big Class.jmp" );
dt = Current Data Table();

Input = New Window( "example", << modal(),
	new1 = hlistbox(
		Text Box( "Test name :" ),
		Para_Num_teb = Text Edit Box( "", <<set width( 200 ) )
	),
		text box("Click OK"),
		Button Box( "OK", 
		Para_Num = Para_Num_teb << get text();
		),
);


dtLimits = New Table("Option Table",
				);



Histogram = Distribution(
	Continuous Distribution(
		column( column(dt, Para_Num )),
		Vertical( 0 ) ,
	  )
	  	
);
	

But, It can't be run.

 

 

I want to make a JSL for creating histogram using the 2nd script.

 

Could you give me any advice?

 

 

 

 

 

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
txnelson
Super User

Re: Why can't create a histogram?

The issue you are having, is that when you added in the lines of code to create the limits table, JMP moved the Current Data Table from Big Class, to the Option Table.  Thus, when the Distribution fired up, it looked to the Option Table for the data.  The simple fix, is to point the Distribution Platform to the data table where the data are.  See below:

Names Default To Here( 1 );
dt = Open( "$Sample_Data/Big Class.jmp" );
dt = Current Data Table();

Input = New Window( "example", << modal(),
	new1 = hlistbox(
		Text Box( "Test name :" ),
		Para_Num_teb = Text Edit Box( "", <<set width( 200 ) )
	),
		text box("Click OK"),
		Button Box( "OK", 
		Para_Num = Para_Num_teb << get text();
		),
);


dtLimits = New Table("Option Table",
				);



Histogram = dt << Distribution(
	Continuous Distribution(
		column( column(dt, Para_Num )),
		Vertical( 0 ) ,
	  )
	  	
);
Jim

View solution in original post

Highlighted
txnelson
Super User

Re: Why can't create a histogram?

The JMP report output is tied to the data table.  So when you close the data table, it has to close the report output.

There are things you can do to get around this.

  1. Copy the report output to a JMP Journal.
  2. Minimize the data table, don't close it.
  3. Use the Show Window() message to hide the data table.
Jim

View solution in original post

5 REPLIES 5
Highlighted
txnelson
Super User

Re: Why can't create a histogram?

The issue you are having, is that when you added in the lines of code to create the limits table, JMP moved the Current Data Table from Big Class, to the Option Table.  Thus, when the Distribution fired up, it looked to the Option Table for the data.  The simple fix, is to point the Distribution Platform to the data table where the data are.  See below:

Names Default To Here( 1 );
dt = Open( "$Sample_Data/Big Class.jmp" );
dt = Current Data Table();

Input = New Window( "example", << modal(),
	new1 = hlistbox(
		Text Box( "Test name :" ),
		Para_Num_teb = Text Edit Box( "", <<set width( 200 ) )
	),
		text box("Click OK"),
		Button Box( "OK", 
		Para_Num = Para_Num_teb << get text();
		),
);


dtLimits = New Table("Option Table",
				);



Histogram = dt << Distribution(
	Continuous Distribution(
		column( column(dt, Para_Num )),
		Vertical( 0 ) ,
	  )
	  	
);
Jim

View solution in original post

Highlighted
LBrian
Level II

Re: Why can't create a histogram?

Your solution which bring me new inspiration, is very simple and perfect everytime.

Thank you
Highlighted
LBrian
Level II

Re: Why can't create a histogram?

Hello, doctor.

 

Could I ask you one more?

I want to close windows except histogram

 

So I added 2 lines using close window().

 

Names Default To Here( 1 );
dt = Open( "$Sample_Data/Big Class.jmp" );
dt = Current Data Table();

Input = New Window( "example", << modal(),
	new1 = hlistbox(
		Text Box( "Test name :" ),
		Para_Num_teb = Text Edit Box( "", <<set width( 200 ) )
	),
		text box("Click OK"),
		Button Box( "OK", 
		Para_Num = Para_Num_teb << get text();
		),
);


dtLimits = New Table("Option Table",
				);



Histogram = dt << Distribution(
	Continuous Distribution(
		column( column(dt, Para_Num )),
		Vertical( 0 ) ,
	  )
	  	
);

window("Option Table") << Close Window();
window(dt) << Close Window();

but this code closed all windows. 

 

Could you give me advice more?

 

 

Highlighted
txnelson
Super User

Re: Why can't create a histogram?

The JMP report output is tied to the data table.  So when you close the data table, it has to close the report output.

There are things you can do to get around this.

  1. Copy the report output to a JMP Journal.
  2. Minimize the data table, don't close it.
  3. Use the Show Window() message to hide the data table.
Jim

View solution in original post

Highlighted
LBrian
Level II

Re: Why can't create a histogram?

Thanks to your advice, I can get a solution.
Thank you!
Article Labels