BookmarkSubscribeRSS Feed
TimH
Quartz | Level 8

Can SGPANEL or SGRENDER be used to put two graphs on a page that _share_ an axis? 

Here's what I would like to do: I have a variable which changes during the day, different values for each category, so I am doing an area chart to show that.  The variations depend upon different processes which are happening, for which I have the start and end times.   I would like to share the horizontal axis which will be 24 hours with a tick each quarter hour,  on top I want the area chart, below I want to do a horizontal high-low chart with the categories on the vertical axis being the process identifiers, and the bars representing the duration of the process.

3 REPLIES 3
Jay54
Meteorite | Level 14

Yes, you can build a GTL template with two graphs and common X axis.  There are many examples, and you can customize to your needs.  Here are a couple of examples from the support page:

35171 - Histogram with Normal and Kernel Density Curves

35040 - Monthly Stock Price and Volume Graph

TimH
Quartz | Level 8

Those are helpful, and I will do more reading about templates but not quite what I was asking.  The examples show multiple charts from on dataset.   I actually have two datasets;  one for the upper chart - the dataset containing the variable I am doing the area chart for -  and one for the lower chart - the start/stop time of the processes.  Since the variable which changes during the day is measured at regular intervals,  and the start/stop times of the processes do not conform to those intervals, I do not think I can merge the two datasets .

Jay54
Meteorite | Level 14

The procedure only supports one data set per graph.  So, you have to merge the data.  It is OK to have two columns (X & Y) for the upper graph and two different columns (X2, Y2) for the lower.  As long as X and X2 are of the same type, the axes can be merged by the graph.  We do that with the survival plot.  The survival graph is with x=Time and the lower at risk table graph is using x=TAtTisk.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1393 views
  • 3 likes
  • 2 in conversation