Data visualization with SAS programming

Getting Gplot ODS graphs in STP side by side

Accepted Solution Solved
Reply
SAS Employee
Posts: 4
Accepted Solution

Getting Gplot ODS graphs in STP side by side


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.


Accepted Solutions
Solution
‎05-04-2015 04:54 PM
SAS Super FREQ
Posts: 706

Re: Getting Gplot ODS graphs in STP side by side

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


All Replies
Solution
‎05-04-2015 04:54 PM
SAS Super FREQ
Posts: 706

Re: Getting Gplot ODS graphs in STP side by side

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;
SAS Super FREQ
Posts: 8,820

Re: Getting Gplot ODS graphs in STP side by side

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

SAS Employee
Posts: 4

Re: Getting Gplot ODS graphs in STP side by side

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

SAS Employee
Posts: 4

Re: Getting Gplot ODS graphs in STP side by side

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

SAS Employee
Posts: 1

Re: Getting Gplot ODS graphs in STP side by side

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?

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

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