cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
neilxu
Level I

How can I export chart via JSL?

First time user here.

I created a bar chart from sas dataset. And tried to save the graph into JPG format. However I found a Chart banner on top of the picture. How can I get rid of it?

How can I write a JSL to output the graph? I have to do lots of similar tasks to generate so many pictures. Obviously I don't want to manually save each picture.

Thanks for your help.
1 ACCEPTED SOLUTION

Accepted Solutions

Re: How can I export chart via JSL?

From above:

 

I did some automation stuff for my work and had to save a generic number of graphs here is the sytax chunk for saving and closing the data table and window.

I used a Oneway graph for my analysis, but insert the code for your specific graph in the Oneway part. You can save the auto generated script and then insert that code into the Window. If you need help on that let me know, but there should be some thread addressing that in the forums.

dt = Open( FILE )
wind = New Window( header, 
Oneway( Y( YCol ), X( :XCol ) );

wind << save picture( "name.JPG", JPEG );
wind << Close Window;
Close( dt, No Save );

Message was edited by: KaptainKodie

 

And, to change the title:

 

After you create the window variable you have to access the box that contains the name and then set the title. Here is the syntax:

wind = New Window( fileName, blah blah);
overies = wind << Child( 1 );
overies << Set Title( "Charts Suck!!" );

Or set it to what you want.

Duane Hayes

View solution in original post

4 REPLIES 4

Re: How can I export chart via JSL?

I did some automation stuff for my work and had to save a generic number of graphs here is the sytax chunk for saving and closing the data table and window.

I used a Oneway graph for my analysis, but insert the code for your specific graph in the Oneway part. You can save the auto generated script and then insert that code into the Window. If you need help on that let me know, but there should be some thread addressing that in the forums.

dt = Open( FILE )
wind = New Window( header, 
Oneway( Y( YCol ), X( :XCol ) );

wind << save picture( "name.JPG", JPEG );
wind << Close Window;
Close( dt, No Save );



Message was edited by: KaptainKodie

neilxu
Level I

Re: How can I export chart via JSL?

Thank you for your help. The code you showed me rocks!

Now I can create a new window and plot the bar chart, then save it.

But it still has the annoying "Chart" banner on top of picture. Do you know how to get rid of it?

Thanks

Re: How can I export chart via JSL?

This one was hard for me to figure out, but you have to use the child function. After you create the window variable you have to access the box that contains the name and then set the title. Here is the syntax:

wind = New Window( fileName, blah blah);
overies = wind << Child( 1 );
overies << Set Title( "Charts Suck!!" );


Or set it to what you want, or not, im not a mind reader.

Re: How can I export chart via JSL?

From above:

 

I did some automation stuff for my work and had to save a generic number of graphs here is the sytax chunk for saving and closing the data table and window.

I used a Oneway graph for my analysis, but insert the code for your specific graph in the Oneway part. You can save the auto generated script and then insert that code into the Window. If you need help on that let me know, but there should be some thread addressing that in the forums.

dt = Open( FILE )
wind = New Window( header, 
Oneway( Y( YCol ), X( :XCol ) );

wind << save picture( "name.JPG", JPEG );
wind << Close Window;
Close( dt, No Save );

Message was edited by: KaptainKodie

 

And, to change the title:

 

After you create the window variable you have to access the box that contains the name and then set the title. Here is the syntax:

wind = New Window( fileName, blah blah);
overies = wind << Child( 1 );
overies << Set Title( "Charts Suck!!" );

Or set it to what you want.

Duane Hayes