Choose Language Hide Translation Bar
Highlighted
dilipkumar
Level II

Saving Dashboard to .jpg or Png format

Hi

I want to save jmp dashboard into to a image file (.jpg..png). can any one can help in that.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Saving Dashboard to .jpg or Png format

Custom window containing multiple platforms:

 

Names Default To Here( 1 );

path = Pick Directory();

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

nw = New Window( "Dashboard",
	dt << Distribution( Y( :weight, :height ) ),
	dt << Bivariate( Y( :weight ), X( :height ) )
);

Wait( 0 );
nw << Save Picture( path || "example.png", "png" );

Custom dashboard:

 

Names Default To Here( 1 );

path = Pick Directory();

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dash = JMP App(
	Set Name( "Dashboard" ),
	Set Description( "Description" ),
	Auto Launch( 1 ),
	Snap To Grid( 1 ),
	Show Grid( 1 ),
	Show Properties( 0 ),
	Show Sources( 1 ),
	Group By Category( 0 ),
	Dashboard Mode( 1 ),
	Parameters,
	Tables(
		DataTable1 = GuiTable(
			Set Path( "$SAMPLE_DATA/Big Class.jmp" ),
			Set Label( "Big Class.jmp" ),
			Set Location( "Current Data Table" ),
			Set Invisible( 0 )
		)
	),
	Script(JSL Quote(// This script is executed when the application is run.
// Named objects have been created for the application modules
// (for example, "Module1") and the pre-defined object
// "thisApplication" refers to the application object itself.
// Variables and functions declared here are scoped to the
// Application namespace.


)	),
	Allocate(
		Module1 = Plan(
			PreAllocate,
			Script(JSL Quote(// This script is executed when a new module instance is
// created.  The pre-defined object "thisModuleInstance" refers
// to the instance object, but other objects such as boxes and
// scripts have not yet been created.  Variables declared here are
// scoped to the ModuleInstance namespace.

// This special function will receive parameters passed to CreateInstance()
OnModuleLoad({},
);

thisModuleInstance << Create Objects;

// After this point your module instance objects have been created
// and can be referred to by name (for example, "Button1").

Try(TabPage3 << Set Scriptable Object(thisApplication));
)			),
			Allocate(
				TabPage3 = Tab Page Box();
				Splitter1 = H Splitter Box();
				TabPage2 = Tab Page Box();
				Scroll2 = Scroll Box();
				Report2 = Platform(
					DataTable1,
					Distribution(
						Continuous Distribution( Column( :weight ) ),
						Continuous Distribution( Column( :height ) )
					)
				);
				TabPage1 = Tab Page Box();
				Scroll1 = Scroll Box();
				Report1 = Platform(
					DataTable1,
					Bivariate( Y( :weight ), X( :height ) )
				);
			),
			Organize(
				Reparent( Scroll1( Report1 ) );
				Reparent( TabPage1( Scroll1 ) );
				Reparent( Splitter1( TabPage1 ) );
				Reparent( Scroll2( Report2 ) );
				Reparent( TabPage2( Scroll2 ) );
				Reparent( Splitter1( TabPage2 ) );
				Reparent( TabPage3( Splitter1 ) );
				Relocate( TabPage3( 0, 0 ) );
			),
			Initialize(
				TabPage3 << Background Color( 2147483647 ),
				TabPage3 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabPage3 << Enabled( 1 ),
				TabPage3 << Horizontal Alignment( "Default" ),
				TabPage3 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabPage3 << Padding(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				),
				TabPage3 << Text Color( 2147483647 ),
				TabPage3 << Vertical Alignment( "Default" ),
				TabPage3 << Visibility( "Visible" ),
				TabPage3 << Title( "Dashboard" ),
				TabPage3 << Tip( "" ),
				TabPage3 << Icon( "" ),
				TabPage3 << Closeable( 0 ),
				TabPage3 << Moveable( 0 ),
				Splitter1 << Background Color( 2147483647 ),
				Splitter1 << Border(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				),
				Splitter1 << Enabled( 1 ),
				Splitter1 << Horizontal Alignment( "Default" ),
				Splitter1 << Margin(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				),
				Splitter1 << Padding(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				),
				Splitter1 << Text Color( 2147483647 ),
				Splitter1 << Vertical Alignment( "Default" ),
				Splitter1 << Visibility( "Visible" ),
				Splitter1 << Dockable( 1 ),
				Splitter1 << Set Width( 1021 ),
				Splitter1 << Set Height( 666 ),
				Splitter1 << Set Sizes( {0.555009823182711, 0.444990176817289} ),
				Splitter1 << set horizontal( 1 ),
				Splitter1 << Set Min Size( 147, 62 ),
				Splitter1 << Set Max Size( 60003, 30000 ),
				Splitter1 << Set Auto Stretching( 1, 1 ),
				TabPage2 << Background Color( 2147483647 ),
				TabPage2 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabPage2 << Enabled( 1 ),
				TabPage2 << Horizontal Alignment( "Default" ),
				TabPage2 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabPage2 << Padding(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				),
				TabPage2 << Text Color( 2147483647 ),
				TabPage2 << Vertical Alignment( "Default" ),
				TabPage2 << Visibility( "Visible" ),
				TabPage2 << Title( "Distributions" ),
				TabPage2 << Tip( "" ),
				TabPage2 << Icon( "Distrib" ),
				TabPage2 << Closeable( 1 ),
				TabPage2 << Moveable( 1 ),
				Scroll2 << Background Color( 2147483647 ),
				Scroll2 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll2 << Enabled( 1 ),
				Scroll2 << Horizontal Alignment( "Default" ),
				Scroll2 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll2 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll2 << Text Color( 2147483647 ),
				Scroll2 << User Resizable( {1, 1} ),
				Scroll2 << Vertical Alignment( "Default" ),
				Scroll2 << Visibility( "Visible" ),
				Scroll2 << Width( 565 ),
				Scroll2 << Height( 640 ),
				Scroll2 << Set Auto Scrollable( 1 ),
				Scroll2 << Set Scrollers( 1, 1 ),
				Scroll2 << Set Background Color( 2147483647 ),
				Scroll2 << Set Show Empty( 0 ),
				Scroll2 << Set Clip Printing( 0 ),
				Scroll2 << Set Min Size( 72, 36 ),
				Scroll2 << Set Max Size( 30000, 30000 ),
				Scroll2 << Set Auto Stretching( 1, 1 ),
				Report2 << Background Color( 2147483647 ),
				Report2 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report2 << Enabled( 1 ),
				Report2 << Horizontal Alignment( "Default" ),
				Report2 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report2 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report2 << Text Color( 2147483647 ),
				Report2 << Vertical Alignment( "Default" ),
				Report2 << Visibility( "Visible" ),
				Report2 << set horizontal( 0 ),
				TabPage1 << Background Color( 2147483647 ),
				TabPage1 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabPage1 << Enabled( 1 ),
				TabPage1 << Horizontal Alignment( "Default" ),
				TabPage1 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabPage1 << Padding(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				),
				TabPage1 << Text Color( 2147483647 ),
				TabPage1 << Vertical Alignment( "Default" ),
				TabPage1 << Visibility( "Visible" ),
				TabPage1 << Title( "Bivariate Fit of weight By height" ),
				TabPage1 << Tip( "" ),
				TabPage1 << Icon( "Bivariate" ),
				TabPage1 << Closeable( 1 ),
				TabPage1 << Moveable( 1 ),
				Scroll1 << Background Color( 2147483647 ),
				Scroll1 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll1 << Enabled( 1 ),
				Scroll1 << Horizontal Alignment( "Default" ),
				Scroll1 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll1 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll1 << Text Color( 2147483647 ),
				Scroll1 << User Resizable( {1, 1} ),
				Scroll1 << Vertical Alignment( "Default" ),
				Scroll1 << Visibility( "Visible" ),
				Scroll1 << Width( 453 ),
				Scroll1 << Height( 640 ),
				Scroll1 << Set Auto Scrollable( 1 ),
				Scroll1 << Set Scrollers( 1, 1 ),
				Scroll1 << Set Background Color( 2147483647 ),
				Scroll1 << Set Show Empty( 0 ),
				Scroll1 << Set Clip Printing( 0 ),
				Scroll1 << Set Min Size( 72, 36 ),
				Scroll1 << Set Max Size( 30000, 30000 ),
				Scroll1 << Set Auto Stretching( 1, 1 ),
				Report1 << Background Color( 2147483647 ),
				Report1 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report1 << Enabled( 1 ),
				Report1 << Horizontal Alignment( "Default" ),
				Report1 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report1 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report1 << Text Color( 2147483647 ),
				Report1 << Vertical Alignment( "Default" ),
				Report1 << Visibility( "Visible" ),
				Report1 << set horizontal( 0 )
			)
		)
	),
	Initialize(
		Module1 << Auto Launch( 1 );
		Module1 << Set Module Type( "Report" );
		Module1 << Set Window Title( "^TABLENAME - ^APPNAME" );
		Module1 << Set Min Size( 0, 0 );
		Module1 << Set Max Size( 30000, 30000 );
		Module1 << Set Auto Stretching( ., . );
	)
) << Run;

Wait( 0 );

dash rep = dash << Get Windows;

dash rep << Save Picture( path || "example.png", "png" );
Learn it once, use it forever!

View solution in original post

6 REPLIES 6
Highlighted

Re: Saving Dashboard to .jpg or Png format

Select Help > Scripting Index. Change browser to Display Boxes. Search for 'jpeg'.

 

Names Default To Here( 1 );
//This message applies to all display box objects
Open( "$SAMPLE_DATA/Big Class.jmp" );
biv = bivariate( y( :weight ), x( :height ) );
rbiv = biv << report;
rbiv << Save Picture( "path/to/example.png", "png" );
Learn it once, use it forever!
Highlighted
dilipkumar
Level II

Re: Saving Dashboard to .jpg or Png format

I think this technique works well with single chart, but i want to convert dash board into image and trying to save them.
Please guide

Regards,
Dilip
Highlighted

Re: Saving Dashboard to .jpg or Png format

Custom window containing multiple platforms:

 

Names Default To Here( 1 );

path = Pick Directory();

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

nw = New Window( "Dashboard",
	dt << Distribution( Y( :weight, :height ) ),
	dt << Bivariate( Y( :weight ), X( :height ) )
);

Wait( 0 );
nw << Save Picture( path || "example.png", "png" );

Custom dashboard:

 

Names Default To Here( 1 );

path = Pick Directory();

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dash = JMP App(
	Set Name( "Dashboard" ),
	Set Description( "Description" ),
	Auto Launch( 1 ),
	Snap To Grid( 1 ),
	Show Grid( 1 ),
	Show Properties( 0 ),
	Show Sources( 1 ),
	Group By Category( 0 ),
	Dashboard Mode( 1 ),
	Parameters,
	Tables(
		DataTable1 = GuiTable(
			Set Path( "$SAMPLE_DATA/Big Class.jmp" ),
			Set Label( "Big Class.jmp" ),
			Set Location( "Current Data Table" ),
			Set Invisible( 0 )
		)
	),
	Script(JSL Quote(// This script is executed when the application is run.
// Named objects have been created for the application modules
// (for example, "Module1") and the pre-defined object
// "thisApplication" refers to the application object itself.
// Variables and functions declared here are scoped to the
// Application namespace.


)	),
	Allocate(
		Module1 = Plan(
			PreAllocate,
			Script(JSL Quote(// This script is executed when a new module instance is
// created.  The pre-defined object "thisModuleInstance" refers
// to the instance object, but other objects such as boxes and
// scripts have not yet been created.  Variables declared here are
// scoped to the ModuleInstance namespace.

// This special function will receive parameters passed to CreateInstance()
OnModuleLoad({},
);

thisModuleInstance << Create Objects;

// After this point your module instance objects have been created
// and can be referred to by name (for example, "Button1").

Try(TabPage3 << Set Scriptable Object(thisApplication));
)			),
			Allocate(
				TabPage3 = Tab Page Box();
				Splitter1 = H Splitter Box();
				TabPage2 = Tab Page Box();
				Scroll2 = Scroll Box();
				Report2 = Platform(
					DataTable1,
					Distribution(
						Continuous Distribution( Column( :weight ) ),
						Continuous Distribution( Column( :height ) )
					)
				);
				TabPage1 = Tab Page Box();
				Scroll1 = Scroll Box();
				Report1 = Platform(
					DataTable1,
					Bivariate( Y( :weight ), X( :height ) )
				);
			),
			Organize(
				Reparent( Scroll1( Report1 ) );
				Reparent( TabPage1( Scroll1 ) );
				Reparent( Splitter1( TabPage1 ) );
				Reparent( Scroll2( Report2 ) );
				Reparent( TabPage2( Scroll2 ) );
				Reparent( Splitter1( TabPage2 ) );
				Reparent( TabPage3( Splitter1 ) );
				Relocate( TabPage3( 0, 0 ) );
			),
			Initialize(
				TabPage3 << Background Color( 2147483647 ),
				TabPage3 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabPage3 << Enabled( 1 ),
				TabPage3 << Horizontal Alignment( "Default" ),
				TabPage3 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabPage3 << Padding(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				),
				TabPage3 << Text Color( 2147483647 ),
				TabPage3 << Vertical Alignment( "Default" ),
				TabPage3 << Visibility( "Visible" ),
				TabPage3 << Title( "Dashboard" ),
				TabPage3 << Tip( "" ),
				TabPage3 << Icon( "" ),
				TabPage3 << Closeable( 0 ),
				TabPage3 << Moveable( 0 ),
				Splitter1 << Background Color( 2147483647 ),
				Splitter1 << Border(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				),
				Splitter1 << Enabled( 1 ),
				Splitter1 << Horizontal Alignment( "Default" ),
				Splitter1 << Margin(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				),
				Splitter1 << Padding(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				),
				Splitter1 << Text Color( 2147483647 ),
				Splitter1 << Vertical Alignment( "Default" ),
				Splitter1 << Visibility( "Visible" ),
				Splitter1 << Dockable( 1 ),
				Splitter1 << Set Width( 1021 ),
				Splitter1 << Set Height( 666 ),
				Splitter1 << Set Sizes( {0.555009823182711, 0.444990176817289} ),
				Splitter1 << set horizontal( 1 ),
				Splitter1 << Set Min Size( 147, 62 ),
				Splitter1 << Set Max Size( 60003, 30000 ),
				Splitter1 << Set Auto Stretching( 1, 1 ),
				TabPage2 << Background Color( 2147483647 ),
				TabPage2 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabPage2 << Enabled( 1 ),
				TabPage2 << Horizontal Alignment( "Default" ),
				TabPage2 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabPage2 << Padding(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				),
				TabPage2 << Text Color( 2147483647 ),
				TabPage2 << Vertical Alignment( "Default" ),
				TabPage2 << Visibility( "Visible" ),
				TabPage2 << Title( "Distributions" ),
				TabPage2 << Tip( "" ),
				TabPage2 << Icon( "Distrib" ),
				TabPage2 << Closeable( 1 ),
				TabPage2 << Moveable( 1 ),
				Scroll2 << Background Color( 2147483647 ),
				Scroll2 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll2 << Enabled( 1 ),
				Scroll2 << Horizontal Alignment( "Default" ),
				Scroll2 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll2 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll2 << Text Color( 2147483647 ),
				Scroll2 << User Resizable( {1, 1} ),
				Scroll2 << Vertical Alignment( "Default" ),
				Scroll2 << Visibility( "Visible" ),
				Scroll2 << Width( 565 ),
				Scroll2 << Height( 640 ),
				Scroll2 << Set Auto Scrollable( 1 ),
				Scroll2 << Set Scrollers( 1, 1 ),
				Scroll2 << Set Background Color( 2147483647 ),
				Scroll2 << Set Show Empty( 0 ),
				Scroll2 << Set Clip Printing( 0 ),
				Scroll2 << Set Min Size( 72, 36 ),
				Scroll2 << Set Max Size( 30000, 30000 ),
				Scroll2 << Set Auto Stretching( 1, 1 ),
				Report2 << Background Color( 2147483647 ),
				Report2 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report2 << Enabled( 1 ),
				Report2 << Horizontal Alignment( "Default" ),
				Report2 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report2 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report2 << Text Color( 2147483647 ),
				Report2 << Vertical Alignment( "Default" ),
				Report2 << Visibility( "Visible" ),
				Report2 << set horizontal( 0 ),
				TabPage1 << Background Color( 2147483647 ),
				TabPage1 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabPage1 << Enabled( 1 ),
				TabPage1 << Horizontal Alignment( "Default" ),
				TabPage1 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				TabPage1 << Padding(
					{Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )}
				),
				TabPage1 << Text Color( 2147483647 ),
				TabPage1 << Vertical Alignment( "Default" ),
				TabPage1 << Visibility( "Visible" ),
				TabPage1 << Title( "Bivariate Fit of weight By height" ),
				TabPage1 << Tip( "" ),
				TabPage1 << Icon( "Bivariate" ),
				TabPage1 << Closeable( 1 ),
				TabPage1 << Moveable( 1 ),
				Scroll1 << Background Color( 2147483647 ),
				Scroll1 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll1 << Enabled( 1 ),
				Scroll1 << Horizontal Alignment( "Default" ),
				Scroll1 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll1 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Scroll1 << Text Color( 2147483647 ),
				Scroll1 << User Resizable( {1, 1} ),
				Scroll1 << Vertical Alignment( "Default" ),
				Scroll1 << Visibility( "Visible" ),
				Scroll1 << Width( 453 ),
				Scroll1 << Height( 640 ),
				Scroll1 << Set Auto Scrollable( 1 ),
				Scroll1 << Set Scrollers( 1, 1 ),
				Scroll1 << Set Background Color( 2147483647 ),
				Scroll1 << Set Show Empty( 0 ),
				Scroll1 << Set Clip Printing( 0 ),
				Scroll1 << Set Min Size( 72, 36 ),
				Scroll1 << Set Max Size( 30000, 30000 ),
				Scroll1 << Set Auto Stretching( 1, 1 ),
				Report1 << Background Color( 2147483647 ),
				Report1 << Border( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report1 << Enabled( 1 ),
				Report1 << Horizontal Alignment( "Default" ),
				Report1 << Margin( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report1 << Padding( {Left( 0 ), Top( 0 ), Right( 0 ), Bottom( 0 )} ),
				Report1 << Text Color( 2147483647 ),
				Report1 << Vertical Alignment( "Default" ),
				Report1 << Visibility( "Visible" ),
				Report1 << set horizontal( 0 )
			)
		)
	),
	Initialize(
		Module1 << Auto Launch( 1 );
		Module1 << Set Module Type( "Report" );
		Module1 << Set Window Title( "^TABLENAME - ^APPNAME" );
		Module1 << Set Min Size( 0, 0 );
		Module1 << Set Max Size( 30000, 30000 );
		Module1 << Set Auto Stretching( ., . );
	)
) << Run;

Wait( 0 );

dash rep = dash << Get Windows;

dash rep << Save Picture( path || "example.png", "png" );
Learn it once, use it forever!

View solution in original post

Highlighted
dilipkumar
Level II

Re: Saving Dashboard to .jpg or Png format

Hi,
Thanks for reply, Now i can able to save the image of Dash board, at same time i am trying to hide the dash board , which is appearing now after executing the script. Is there any way to hide the dash board and only image get saved.

Regards,
Dilip
Highlighted

Re: Saving Dashboard to .jpg or Png format

You would add the Invisible argument to the JMP App( ) function call.

 

You would also have to close the app as well after the picture is saved.

Learn it once, use it forever!
Highlighted
dilipkumar
Level II

Re: Saving Dashboard to .jpg or Png format

If possible can you provide any example ?

Article Labels

    There are no labels assigned to this post.