BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.


Hi

I have tried to generate the gplot graphs as files and then the idea was to use a general HTML file that referenced the produced png Gplot graphs directly. But using STP, the STP output always adds a lot of general code and this could be used, but it places a <br> between each gplot graph being produced by the STP program. I wonder if any of you have made such a STP graph that just puts 2-4 gplot graphs side by side and NOT underneith each other, as the default result is. THe Gplot graphs is independent.

1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

Hi

You can use ODS LAYOUT to have several graphs side by side, you need to know how many "columns" you are going to have, so you can adjust it accordingly. See code sample below. Before each graph or table you need an ODS REGION statement.

ods layout gridded columns=2;

ods region;
proc gchart data=sashelp.cars;
  vbar type;
run;
quit;

ods region;
proc gchart data=sashelp.cars;
  vbar origin;
run;
quit;

ods layout end;

View solution in original post

5 REPLIES 5
BrunoMueller
SAS Super FREQ

Hi

You can use ODS LAYOUT to have several graphs side by side, you need to know how many "columns" you are going to have, so you can adjust it accordingly. See code sample below. Before each graph or table you need an ODS REGION statement.

ods layout gridded columns=2;

ods region;
proc gchart data=sashelp.cars;
  vbar type;
run;
quit;

ods region;
proc gchart data=sashelp.cars;
  vbar origin;
run;
quit;

ods layout end;
Cynthia_sas
SAS Super FREQ

Hi:

  Also, remember to choose your destination of choice carefully in your SP, ODS LAYOUT may not be supported by all destinations. Refer to the doc to double check which destinations supports the layout you want.

cynthia

TorOveKilnes
SAS Employee

Yes, Thank you all. There are many ways and dead-ends here, and using ODS Layout, ods region as above is a good and easy way to create gridded graphs side-by-side..ODS tagsets.htmlpanel, sgpanel or controlling _webout is all cumbersume and not giving the same practical results here. There is a couple of good resources for ODS layout:

https://communities.sas.com/message/191928#191928

http://www.misug.org/uploads/8/1/9/1/8191072/cparker_ods_menu.pdf ( abit old, but explains it)

Tor Ove

TorOveKilnes
SAS Employee

Yes, thanks all

The ODS Layout with ODS Region is the best solution to this. Using variations like tagset.htmlpanel, sgplot or controlling _webout does not lead to a simple (especially for matrixes like 2x2, 4x1) and generic solution like ODS layout does. Some useful links:

http://www.misug.org/uploads/8/1/9/1/8191072/cparker_ods_menu.pdf (old but explains how ODS layout works)

https://communities.sas.com/message/191928 (Different thread here).
Tor Ove

TorOve
SAS Employee

Yes. I figured out that for example ActiveX and Java device not is supported, while ActXImg is. It there a way that you know of that can put such graphs out with ActiveX/Java device, in order to get the "hoover over", zoom etc, functionality?

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 2309 views
  • 0 likes
  • 4 in conversation